@limetech/lime-crm-building-blocks 1.126.1 → 1.126.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.126.3](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.126.2...v1.126.3) (2026-05-28)
2
+
3
+ ### Bug Fixes
4
+
5
+
6
+ * **rule-gate:** fail closed when rule compilation throws ([3a91f56](https://github.com/Lundalogik/lime-crm-building-blocks/commit/3a91f56ed368bc233e5eff577964948e277b0e6b))
7
+
8
+ ## [1.126.2](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.126.1...v1.126.2) (2026-05-27)
9
+
10
+ ### Bug Fixes
11
+
12
+
13
+ * **rule-editor:** translate primitive metadata title and description ([8f74a9f](https://github.com/Lundalogik/lime-crm-building-blocks/commit/8f74a9fe52f2c8df3839d415df165bfa6845c1e1))
14
+
1
15
  ## [1.126.1](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.126.0...v1.126.1) (2026-05-26)
2
16
 
3
17
  ### Bug Fixes
@@ -32,9 +32,11 @@ const RuleChipPopover = class {
32
32
  return (index.h("div", { key: '6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f', class: "popover" }, this.renderHeader(), this.renderBody()));
33
33
  }
34
34
  renderHeader() {
35
- var _a, _b, _c, _d, _e;
36
- const title = (_d = (_b = (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : (_c = this.refNode) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '';
37
- return (index.h("limel-header", { class: "popover__header is-narrow", heading: title, icon: (_e = this.metadata) === null || _e === void 0 ? void 0 : _e.icon }, this.renderHeaderActions()));
35
+ var _a, _b, _c, _d;
36
+ const title = ((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.title)
37
+ ? this.translator.get(this.metadata.title)
38
+ : ((_c = (_b = this.refNode) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : '');
39
+ return (index.h("limel-header", { class: "popover__header is-narrow", heading: title, icon: (_d = this.metadata) === null || _d === void 0 ? void 0 : _d.icon }, this.renderHeaderActions()));
38
40
  }
39
41
  renderHeaderActions() {
40
42
  if (!this.isMutable) {
@@ -155,20 +155,23 @@ function nodeClasses(type, issues) {
155
155
  }
156
156
  /**
157
157
  * Build the searchable list shown by the primitive pickers. Cached on
158
- * the render context so it isn't recomputed per node.
158
+ * the render context so it isn't recomputed per node. `meta.title` and
159
+ * `meta.description` are passed through the translator so callers can
160
+ * register translation keys as metadata — plain strings travel through
161
+ * unchanged.
159
162
  * @param metadataById
163
+ * @param translator
160
164
  */
161
- function createPrimitiveOptions(metadataById) {
165
+ function createPrimitiveOptions(metadataById, translator) {
162
166
  return [...metadataById.values()]
163
- .map((meta) => {
164
- var _a, _b;
165
- return ({
166
- value: meta.id,
167
- text: (_a = meta.title) !== null && _a !== void 0 ? _a : meta.id,
168
- secondaryText: (_b = meta.description) !== null && _b !== void 0 ? _b : '',
169
- icon: meta.icon,
170
- });
171
- })
167
+ .map((meta) => ({
168
+ value: meta.id,
169
+ text: meta.title ? translator.get(meta.title) : meta.id,
170
+ secondaryText: meta.description
171
+ ? translator.get(meta.description)
172
+ : '',
173
+ icon: meta.icon,
174
+ }))
172
175
  .sort((a, b) => a.text.localeCompare(b.text));
173
176
  }
174
177
  /**
@@ -549,7 +552,7 @@ const RuleEditor = class {
549
552
  var _a, _b, _c;
550
553
  const metadata = (_c = (_b = (_a = this.ruleRegistry).listMetadata) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];
551
554
  this.metadataById = new Map(metadata.map((item) => [item.id, item]));
552
- this.primitiveOptions = createPrimitiveOptions(this.metadataById);
555
+ this.primitiveOptions = createPrimitiveOptions(this.metadataById, this.platform.get(index_esm.n.Translate));
553
556
  }
554
557
  runValidation() {
555
558
  if (!this.value) {
@@ -31,9 +31,18 @@ const RuleGate = class {
31
31
  this.shouldRender = true;
32
32
  return;
33
33
  }
34
- const compiled = this.ruleRegistry.compile(this.rule);
35
- const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
36
- this.shouldRender = compiled(scope);
34
+ try {
35
+ const compiled = this.ruleRegistry.compile(this.rule);
36
+ const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
37
+ this.shouldRender = compiled(scope);
38
+ }
39
+ catch (error) {
40
+ console.warn('rule-gate failed to compile rule; hiding slot', {
41
+ rule: this.rule,
42
+ error,
43
+ });
44
+ this.shouldRender = false;
45
+ }
37
46
  }
38
47
  get host() { return index.getElement(this); }
39
48
  static get watchers() { return {
@@ -30,9 +30,11 @@ export class RuleChipPopover {
30
30
  return (h("div", { key: '6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f', class: "popover" }, this.renderHeader(), this.renderBody()));
31
31
  }
32
32
  renderHeader() {
33
- var _a, _b, _c, _d, _e;
34
- const title = (_d = (_b = (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : (_c = this.refNode) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '';
35
- return (h("limel-header", { class: "popover__header is-narrow", heading: title, icon: (_e = this.metadata) === null || _e === void 0 ? void 0 : _e.icon }, this.renderHeaderActions()));
33
+ var _a, _b, _c, _d;
34
+ const title = ((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.title)
35
+ ? this.translator.get(this.metadata.title)
36
+ : ((_c = (_b = this.refNode) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : '');
37
+ return (h("limel-header", { class: "popover__header is-narrow", heading: title, icon: (_d = this.metadata) === null || _d === void 0 ? void 0 : _d.icon }, this.renderHeaderActions()));
36
38
  }
37
39
  renderHeaderActions() {
38
40
  if (!this.isMutable) {
@@ -106,7 +106,7 @@ export class RuleEditor {
106
106
  var _a, _b, _c;
107
107
  const metadata = (_c = (_b = (_a = this.ruleRegistry).listMetadata) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];
108
108
  this.metadataById = new Map(metadata.map((item) => [item.id, item]));
109
- this.primitiveOptions = createPrimitiveOptions(this.metadataById);
109
+ this.primitiveOptions = createPrimitiveOptions(this.metadataById, this.platform.get(PlatformServiceName.Translate));
110
110
  }
111
111
  runValidation() {
112
112
  if (!this.value) {
@@ -17,20 +17,23 @@ export function nodeClasses(type, issues) {
17
17
  }
18
18
  /**
19
19
  * Build the searchable list shown by the primitive pickers. Cached on
20
- * the render context so it isn't recomputed per node.
20
+ * the render context so it isn't recomputed per node. `meta.title` and
21
+ * `meta.description` are passed through the translator so callers can
22
+ * register translation keys as metadata — plain strings travel through
23
+ * unchanged.
21
24
  * @param metadataById
25
+ * @param translator
22
26
  */
23
- export function createPrimitiveOptions(metadataById) {
27
+ export function createPrimitiveOptions(metadataById, translator) {
24
28
  return [...metadataById.values()]
25
- .map((meta) => {
26
- var _a, _b;
27
- return ({
28
- value: meta.id,
29
- text: (_a = meta.title) !== null && _a !== void 0 ? _a : meta.id,
30
- secondaryText: (_b = meta.description) !== null && _b !== void 0 ? _b : '',
31
- icon: meta.icon,
32
- });
33
- })
29
+ .map((meta) => ({
30
+ value: meta.id,
31
+ text: meta.title ? translator.get(meta.title) : meta.id,
32
+ secondaryText: meta.description
33
+ ? translator.get(meta.description)
34
+ : '',
35
+ icon: meta.icon,
36
+ }))
34
37
  .sort((a, b) => a.text.localeCompare(b.text));
35
38
  }
36
39
  /**
@@ -37,9 +37,18 @@ export class RuleGate {
37
37
  this.shouldRender = true;
38
38
  return;
39
39
  }
40
- const compiled = this.ruleRegistry.compile(this.rule);
41
- const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
42
- this.shouldRender = compiled(scope);
40
+ try {
41
+ const compiled = this.ruleRegistry.compile(this.rule);
42
+ const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
43
+ this.shouldRender = compiled(scope);
44
+ }
45
+ catch (error) {
46
+ console.warn('rule-gate failed to compile rule; hiding slot', {
47
+ rule: this.rule,
48
+ error,
49
+ });
50
+ this.shouldRender = false;
51
+ }
43
52
  }
44
53
  static get is() { return "limebb-rule-gate"; }
45
54
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- import{h as e,proxyCustomElement as t,HTMLElement as n,createEvent as r,transformTag as l}from"@stencil/core/internal/client";import{b as o}from"./index.esm.js";import{d as i}from"./rule-chip-popover.js";function s(e,t){return t?{type:"not",rule:e}:e}function u(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function a(e,t){return e.filter((e=>u(e.path,t)))}function c(e,t){let n=e;for(const e of t)n=h(n,e);return n}function d(e,t,n){if(0===t.length)return n;const[r,...l]=t;if("not"===e.type&&"rule"===r)return Object.assign(Object.assign({},e),{rule:d(e.rule,l,n)});if(("all"===e.type||"any"===e.type)&&"rules"===r){if(0===l.length)return n;const[t,...r]=l;if("number"!=typeof t)return e;const o=[...e.rules];return o[t]=d(o[t],r,n),Object.assign(Object.assign({},e),{rules:o})}return e}function h(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const p={name:"question",color:"rgb(var(--color-glaucous-light))"};function f(e,t){return{"rule-node":!0,["rule-node--"+e]:!0,"rule-node--invalid":t.length>0}}function b(e){return"__chip__:"+e}function m(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const v=({groupNode:t,groupPath:n,chipChildren:r,ctx:l})=>{const o=new Map,i=r.map((e=>{const t=b(e.index);o.set(t,e);const n=function(e,t){var n;return null!==(n=e.find((e=>e.value===t)))&&void 0!==n?n:{value:t,text:t,icon:p}}(l.primitiveOptions,e.ref.id);return Object.assign(Object.assign({},n),{text:e.isNegated?"¬ "+n.text:n.text,value:t})})),s=function(e){return t=>Promise.resolve(function(e,t){if(!t)return e;const n=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>n.every((t=>{var n,r;return e.text.toLocaleLowerCase().includes(t)||(null===(n=e.secondaryText)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))||(null===(r=e.value)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))}))))}(e,t))}(l.primitiveOptions),u=function(e,t,n){var r;const l=j(t,n);return null===l?null:null!==(r=e.find((e=>e.index===l)))&&void 0!==r?r:null}(r,n,l.openChipPath),a="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==u,openDirection:"bottom-start",onClose:l.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:l.translator.get("webclient.rule-editor.rules-label"),value:i,searcher:s,delimiter:a,readonly:l.readonly,disabled:l.disabled,onChange:g(t,n,o,l),onInteract:_(n,o,l)})),e("div",null,function(t,n,r){if(!t)return null;const l=function(e,t){return[...e,"rules",t]}(n,t.index);return e("limebb-rule-chip-popover",{platform:r.platform,context:r.context,refNode:t.ref,isNegated:t.isNegated,metadata:r.metadataById.get(t.ref.id),readonly:r.readonly,disabled:r.disabled,isMutable:r.isMutable,onNegate:y(t,l,r),onUpdateArgs:x(t,l,r),onDeleteChip:C(l,r)})}(u,n,l)))},g=(e,t,n,r)=>l=>{l.stopPropagation();const o=Array.isArray(l.detail)?l.detail:[],i=j(t,r.openChipPath);if(null!==i){const e=b(i);o.every((t=>t.value!==e))&&r.onPopoverClose()}const s=o.flatMap((e=>{if("string"!=typeof e.value)return[];const t=n.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===m(e)));r.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},_=(e,t,n)=>r=>{r.stopPropagation();const l=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(r.detail),o=l?t.get(l):void 0;o&&n.onChipInteract([...e,"rules",o.index])},y=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,r.detail?{type:"not",rule:e.ref}:e.ref)},x=(e,t,n)=>r=>{r.stopPropagation();const l=e.isNegated?[...t,"rule"]:t;n.onUpdateArgs(l,r.detail)},C=(e,t)=>()=>{t.onDelete(e)};function j(e,t){if(!t||t.length<2)return null;if(!u(function(e){return e.slice(0,-2)}(t),e))return null;const n=t.at(-1);return"number"==typeof n?n:null}const w=({node:t,path:n,isNegated:r,ctx:l})=>{const o=r?[...n,"rule"]:n,i=r?[...a(l.issues,n),...a(l.issues,o)]:a(l.issues,n),s=[],u=[];for(const[e,n]of t.rules.entries()){const t=m(n);t?s.push(Object.assign(Object.assign({},t),{index:e})):u.push({child:n,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(l),d=c.find((e=>e.value===t.type));return e("div",{class:f(t.type,i),key:O(n)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!l.isMutable,onChange:k(t,n,r,l)}),function(t,n,r,l){return l.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:l.translator.get("webclient.rule-editor.negate"),value:r,onChange:A(t,n,l)}),e("limel-icon-button",{icon:"trash",label:l.translator.get("webclient.rule-editor.delete"),onClick:()=>l.onDelete(n)})):null}(t,n,r,l)),e("div",{class:"rule-node__body"},e(D,{issues:i}),e(v,{groupNode:t,groupPath:o,chipChildren:s,ctx:l}),function(t,n,r){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(M,{node:t.child,path:[...n,"rules",t.index],ctx:r}))))}(u,o,l),function(t,n,r,l){return l.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:l.translator.get("webclient.rule-editor.add-nested-group"),onClick:z(t,n,r,l)})):null}(t,n,r,l)))};function O(e){return 0===e.length?"root":e.join("/")}function N(e,t,n,r){r.onReplaceNode(t,s(e,n))}const k=(e,t,n,r)=>l=>{l.stopPropagation();const o=l.detail.value;o!==e.type&&N(Object.assign(Object.assign({},e),{type:o}),t,n,r)},z=(e,t,n,r)=>()=>{N(function(e){return Object.assign(Object.assign({},e),{rules:[...e.rules,{type:"all",rules:[]}]})}(e),t,n,r)},A=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,s(e,r.detail))},M=t=>{const{node:n,path:r,ctx:l}=t,o=V(n);return o?e(w,{node:o.node,path:r,isNegated:o.isNegated,ctx:l}):null},P=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function V(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(P(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=V(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const D=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),E=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=r(this,"change",7),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.primitiveOptions=[],this.normalizedCache=null,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const n=t.slice(0,-1),r=t.at(-1),l=c(e,n);if(("all"===l.type||"any"===l.type)&&"number"==typeof r){const t=[...l.rules];return t.splice(r,1),d(e,n,Object.assign(Object.assign({},l),{rules:t}))}return"not"===l.type&&"rule"===r?d(e,n,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,n){const r=c(e,t);return"ref"!==r.type?e:d(e,t,Object.assign(Object.assign({},r),{args:n}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,n){return d(e,t,n)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.indexMetadata(),this.runValidation()}componentDidLoad(){this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.runValidation()}render(){return e("div",{key:"8e0da39f6544c86de0143e91a6c48c9f2654315f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(M,{key:"cd093f5dc5a9b747036f581e6230f1205cf834e6",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,primitiveOptions:this.primitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.platform.get(o.Translate),openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,n;const r=null!==(n=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==n?n:[];this.metadataById=new Map(r.map((e=>[e.id,e]))),this.primitiveOptions=function(e){return[...e.values()].map((e=>{var t,n;return{value:e.id,text:null!==(t=e.title)&&void 0!==t?t:e.id,secondaryText:null!==(n=e.description)&&void 0!==n?n:"",icon:e.icon}})).sort(((e,t)=>e.text.localeCompare(t.text)))}(this.metadataById)}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,this.availableContexts);this.issues=e.ok?[]:e.issues}emitIfChanged(e){e!==this.normalizedValue&&this.change.emit(function(e){return"all"!==e.type&&"any"!==e.type?e:0===e.rules.length?void 0:e}(e))}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=function(e){return e?V(e)?e:{type:"all",rules:[e]}:{type:"all",rules:[]}}(this.value);return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(o.RuleRegistry)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}static get style(){return":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}"}},[1,"limebb-rule-editor",{platform:[16],context:[16],value:[16],availableContexts:[16],required:[516],readonly:[516],disabled:[516],label:[513],helperText:[1,"helper-text"],issues:[32],openChipPath:[32]},void 0,{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}]),I=E,L=function(){"undefined"!=typeof customElements&&["limebb-rule-editor","limebb-rule-chip-popover"].forEach((e=>{switch(e){case"limebb-rule-editor":customElements.get(l(e))||customElements.define(l(e),E);break;case"limebb-rule-chip-popover":customElements.get(l(e))||i()}}))};export{I as LimebbRuleEditor,L as defineCustomElement}
1
+ import{h as e,proxyCustomElement as t,HTMLElement as n,createEvent as r,transformTag as l}from"@stencil/core/internal/client";import{b as o}from"./index.esm.js";import{d as i}from"./rule-chip-popover.js";function s(e,t){return t?{type:"not",rule:e}:e}function u(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function a(e,t){return e.filter((e=>u(e.path,t)))}function c(e,t){let n=e;for(const e of t)n=h(n,e);return n}function d(e,t,n){if(0===t.length)return n;const[r,...l]=t;if("not"===e.type&&"rule"===r)return Object.assign(Object.assign({},e),{rule:d(e.rule,l,n)});if(("all"===e.type||"any"===e.type)&&"rules"===r){if(0===l.length)return n;const[t,...r]=l;if("number"!=typeof t)return e;const o=[...e.rules];return o[t]=d(o[t],r,n),Object.assign(Object.assign({},e),{rules:o})}return e}function h(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const p={name:"question",color:"rgb(var(--color-glaucous-light))"};function f(e,t){return{"rule-node":!0,["rule-node--"+e]:!0,"rule-node--invalid":t.length>0}}function b(e){return"__chip__:"+e}function m(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const v=({groupNode:t,groupPath:n,chipChildren:r,ctx:l})=>{const o=new Map,i=r.map((e=>{const t=b(e.index);o.set(t,e);const n=function(e,t){var n;return null!==(n=e.find((e=>e.value===t)))&&void 0!==n?n:{value:t,text:t,icon:p}}(l.primitiveOptions,e.ref.id);return Object.assign(Object.assign({},n),{text:e.isNegated?"¬ "+n.text:n.text,value:t})})),s=function(e){return t=>Promise.resolve(function(e,t){if(!t)return e;const n=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>n.every((t=>{var n,r;return e.text.toLocaleLowerCase().includes(t)||(null===(n=e.secondaryText)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))||(null===(r=e.value)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))}))))}(e,t))}(l.primitiveOptions),u=function(e,t,n){var r;const l=j(t,n);return null===l?null:null!==(r=e.find((e=>e.index===l)))&&void 0!==r?r:null}(r,n,l.openChipPath),a="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==u,openDirection:"bottom-start",onClose:l.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:l.translator.get("webclient.rule-editor.rules-label"),value:i,searcher:s,delimiter:a,readonly:l.readonly,disabled:l.disabled,onChange:g(t,n,o,l),onInteract:_(n,o,l)})),e("div",null,function(t,n,r){if(!t)return null;const l=function(e,t){return[...e,"rules",t]}(n,t.index);return e("limebb-rule-chip-popover",{platform:r.platform,context:r.context,refNode:t.ref,isNegated:t.isNegated,metadata:r.metadataById.get(t.ref.id),readonly:r.readonly,disabled:r.disabled,isMutable:r.isMutable,onNegate:y(t,l,r),onUpdateArgs:x(t,l,r),onDeleteChip:C(l,r)})}(u,n,l)))},g=(e,t,n,r)=>l=>{l.stopPropagation();const o=Array.isArray(l.detail)?l.detail:[],i=j(t,r.openChipPath);if(null!==i){const e=b(i);o.every((t=>t.value!==e))&&r.onPopoverClose()}const s=o.flatMap((e=>{if("string"!=typeof e.value)return[];const t=n.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===m(e)));r.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},_=(e,t,n)=>r=>{r.stopPropagation();const l=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(r.detail),o=l?t.get(l):void 0;o&&n.onChipInteract([...e,"rules",o.index])},y=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,r.detail?{type:"not",rule:e.ref}:e.ref)},x=(e,t,n)=>r=>{r.stopPropagation();const l=e.isNegated?[...t,"rule"]:t;n.onUpdateArgs(l,r.detail)},C=(e,t)=>()=>{t.onDelete(e)};function j(e,t){if(!t||t.length<2)return null;if(!u(function(e){return e.slice(0,-2)}(t),e))return null;const n=t.at(-1);return"number"==typeof n?n:null}const w=({node:t,path:n,isNegated:r,ctx:l})=>{const o=r?[...n,"rule"]:n,i=r?[...a(l.issues,n),...a(l.issues,o)]:a(l.issues,n),s=[],u=[];for(const[e,n]of t.rules.entries()){const t=m(n);t?s.push(Object.assign(Object.assign({},t),{index:e})):u.push({child:n,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(l),d=c.find((e=>e.value===t.type));return e("div",{class:f(t.type,i),key:O(n)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!l.isMutable,onChange:k(t,n,r,l)}),function(t,n,r,l){return l.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:l.translator.get("webclient.rule-editor.negate"),value:r,onChange:A(t,n,l)}),e("limel-icon-button",{icon:"trash",label:l.translator.get("webclient.rule-editor.delete"),onClick:()=>l.onDelete(n)})):null}(t,n,r,l)),e("div",{class:"rule-node__body"},e(D,{issues:i}),e(v,{groupNode:t,groupPath:o,chipChildren:s,ctx:l}),function(t,n,r){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(M,{node:t.child,path:[...n,"rules",t.index],ctx:r}))))}(u,o,l),function(t,n,r,l){return l.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:l.translator.get("webclient.rule-editor.add-nested-group"),onClick:z(t,n,r,l)})):null}(t,n,r,l)))};function O(e){return 0===e.length?"root":e.join("/")}function N(e,t,n,r){r.onReplaceNode(t,s(e,n))}const k=(e,t,n,r)=>l=>{l.stopPropagation();const o=l.detail.value;o!==e.type&&N(Object.assign(Object.assign({},e),{type:o}),t,n,r)},z=(e,t,n,r)=>()=>{N(function(e){return Object.assign(Object.assign({},e),{rules:[...e.rules,{type:"all",rules:[]}]})}(e),t,n,r)},A=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,s(e,r.detail))},M=t=>{const{node:n,path:r,ctx:l}=t,o=V(n);return o?e(w,{node:o.node,path:r,isNegated:o.isNegated,ctx:l}):null},P=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function V(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(P(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=V(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const D=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),E=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=r(this,"change",7),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.primitiveOptions=[],this.normalizedCache=null,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const n=t.slice(0,-1),r=t.at(-1),l=c(e,n);if(("all"===l.type||"any"===l.type)&&"number"==typeof r){const t=[...l.rules];return t.splice(r,1),d(e,n,Object.assign(Object.assign({},l),{rules:t}))}return"not"===l.type&&"rule"===r?d(e,n,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,n){const r=c(e,t);return"ref"!==r.type?e:d(e,t,Object.assign(Object.assign({},r),{args:n}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,n){return d(e,t,n)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.indexMetadata(),this.runValidation()}componentDidLoad(){this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.runValidation()}render(){return e("div",{key:"8e0da39f6544c86de0143e91a6c48c9f2654315f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(M,{key:"cd093f5dc5a9b747036f581e6230f1205cf834e6",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,primitiveOptions:this.primitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.platform.get(o.Translate),openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,n;const r=null!==(n=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==n?n:[];this.metadataById=new Map(r.map((e=>[e.id,e]))),this.primitiveOptions=function(e,t){return[...e.values()].map((e=>({value:e.id,text:e.title?t.get(e.title):e.id,secondaryText:e.description?t.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text)))}(this.metadataById,this.platform.get(o.Translate))}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,this.availableContexts);this.issues=e.ok?[]:e.issues}emitIfChanged(e){e!==this.normalizedValue&&this.change.emit(function(e){return"all"!==e.type&&"any"!==e.type?e:0===e.rules.length?void 0:e}(e))}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=function(e){return e?V(e)?e:{type:"all",rules:[e]}:{type:"all",rules:[]}}(this.value);return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(o.RuleRegistry)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}static get style(){return":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}"}},[1,"limebb-rule-editor",{platform:[16],context:[16],value:[16],availableContexts:[16],required:[516],readonly:[516],disabled:[516],label:[513],helperText:[1,"helper-text"],issues:[32],openChipPath:[32]},void 0,{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}]),I=E,L=function(){"undefined"!=typeof customElements&&["limebb-rule-editor","limebb-rule-chip-popover"].forEach((e=>{switch(e){case"limebb-rule-editor":customElements.get(l(e))||customElements.define(l(e),E);break;case"limebb-rule-chip-popover":customElements.get(l(e))||i()}}))};export{I as LimebbRuleEditor,L as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as s,Host as n,transformTag as o}from"@stencil/core/internal/client";import{b as i}from"./index.esm.js";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return s(n,{key:"365df6908301371b8b964671382ad936971b6624",hidden:!this.shouldRender},s("slot",{key:"ca7c2a9febf0189dfae882a2ae894d1d0262a213"}))}get ruleRegistry(){return this.platform.get(i.RuleRegistry)}compileAndEvaluate(){var e;if(!this.rule)return void(this.shouldRender=!0);const t=this.ruleRegistry.compile(this.rule),s=null!==(e=this.scope)&&void 0!==e?e:this.ruleRegistry.scope({host:this.host});this.shouldRender=t(s)}get host(){return this}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}static get style(){return":host{display:contents}:host([hidden]){display:none}"}},[257,"limebb-rule-gate",{platform:[16],rule:[16],scope:[16],shouldRender:[32]},void 0,{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}]),l=r,h=function(){"undefined"!=typeof customElements&&["limebb-rule-gate"].forEach((e=>{"limebb-rule-gate"===e&&(customElements.get(o(e))||customElements.define(o(e),r))}))};export{l as LimebbRuleGate,h as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as s,Host as o,transformTag as n}from"@stencil/core/internal/client";import{b as i}from"./index.esm.js";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return s(o,{key:"365df6908301371b8b964671382ad936971b6624",hidden:!this.shouldRender},s("slot",{key:"ca7c2a9febf0189dfae882a2ae894d1d0262a213"}))}get ruleRegistry(){return this.platform.get(i.RuleRegistry)}compileAndEvaluate(){var e;if(this.rule)try{const t=this.ruleRegistry.compile(this.rule),s=null!==(e=this.scope)&&void 0!==e?e:this.ruleRegistry.scope({host:this.host});this.shouldRender=t(s)}catch(e){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:e}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return this}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}static get style(){return":host{display:contents}:host([hidden]){display:none}"}},[257,"limebb-rule-gate",{platform:[16],rule:[16],scope:[16],shouldRender:[32]},void 0,{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}]),l=r,h=function(){"undefined"!=typeof customElements&&["limebb-rule-gate"].forEach((e=>{"limebb-rule-gate"===e&&(customElements.get(n(e))||customElements.define(n(e),r))}))};export{l as LimebbRuleGate,h as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as o,h as i,transformTag as r}from"@stencil/core/internal/client";import{b as s}from"./index.esm.js";import{L as l}from"./web-component-template.js";const a=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.negate=o(this,"negate",7),this.updateArgs=o(this,"updateArgs",7),this.deleteChip=o(this,"deleteChip",7),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return i("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,t,o,r,s;const l=null!==(r=null!==(t=null===(e=this.metadata)||void 0===e?void 0:e.title)&&void 0!==t?t:null===(o=this.refNode)||void 0===o?void 0:o.id)&&void 0!==r?r:"";return i("limel-header",{class:"popover__header is-narrow",heading:l,icon:null===(s=this.metadata)||void 0===s?void 0:s.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?i("div",{slot:"actions",class:"popover__header-actions"},i("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),i("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(s.Translate)}renderBody(){var e,t;const o=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return o?i("div",{class:"popover__body"},i(l,{platform:this.platform,context:this.context,name:o.name,props:Object.assign(Object.assign({},o.props),{value:null===(t=this.refNode)||void 0===t?void 0:t.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}static get style(){return":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}"}},[1,"limebb-rule-chip-popover",{platform:[16],context:[16],refNode:[16],isNegated:[4,"is-negated"],metadata:[16],readonly:[4],disabled:[4],isMutable:[4,"is-mutable"]}]);function n(){"undefined"!=typeof customElements&&["limebb-rule-chip-popover"].forEach((e=>{"limebb-rule-chip-popover"===e&&(customElements.get(r(e))||customElements.define(r(e),a))}))}export{a as R,n as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as o,transformTag as r}from"@stencil/core/internal/client";import{b as s}from"./index.esm.js";import{L as a}from"./web-component-template.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.negate=i(this,"negate",7),this.updateArgs=i(this,"updateArgs",7),this.deleteChip=i(this,"deleteChip",7),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return o("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,t,i,r;const s=(null===(e=this.metadata)||void 0===e?void 0:e.title)?this.translator.get(this.metadata.title):null!==(i=null===(t=this.refNode)||void 0===t?void 0:t.id)&&void 0!==i?i:"";return o("limel-header",{class:"popover__header is-narrow",heading:s,icon:null===(r=this.metadata)||void 0===r?void 0:r.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?o("div",{slot:"actions",class:"popover__header-actions"},o("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),o("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(s.Translate)}renderBody(){var e,t;const i=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return i?o("div",{class:"popover__body"},o(a,{platform:this.platform,context:this.context,name:i.name,props:Object.assign(Object.assign({},i.props),{value:null===(t=this.refNode)||void 0===t?void 0:t.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}static get style(){return":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}"}},[1,"limebb-rule-chip-popover",{platform:[16],context:[16],refNode:[16],isNegated:[4,"is-negated"],metadata:[16],readonly:[4],disabled:[4],isMutable:[4,"is-mutable"]}]);function n(){"undefined"!=typeof customElements&&["limebb-rule-chip-popover"].forEach((e=>{"limebb-rule-chip-popover"===e&&(customElements.get(r(e))||customElements.define(r(e),l))}))}export{l as R,n as d}
@@ -30,9 +30,11 @@ const RuleChipPopover = class {
30
30
  return (h("div", { key: '6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f', class: "popover" }, this.renderHeader(), this.renderBody()));
31
31
  }
32
32
  renderHeader() {
33
- var _a, _b, _c, _d, _e;
34
- const title = (_d = (_b = (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : (_c = this.refNode) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : '';
35
- return (h("limel-header", { class: "popover__header is-narrow", heading: title, icon: (_e = this.metadata) === null || _e === void 0 ? void 0 : _e.icon }, this.renderHeaderActions()));
33
+ var _a, _b, _c, _d;
34
+ const title = ((_a = this.metadata) === null || _a === void 0 ? void 0 : _a.title)
35
+ ? this.translator.get(this.metadata.title)
36
+ : ((_c = (_b = this.refNode) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : '');
37
+ return (h("limel-header", { class: "popover__header is-narrow", heading: title, icon: (_d = this.metadata) === null || _d === void 0 ? void 0 : _d.icon }, this.renderHeaderActions()));
36
38
  }
37
39
  renderHeaderActions() {
38
40
  if (!this.isMutable) {
@@ -153,20 +153,23 @@ function nodeClasses(type, issues) {
153
153
  }
154
154
  /**
155
155
  * Build the searchable list shown by the primitive pickers. Cached on
156
- * the render context so it isn't recomputed per node.
156
+ * the render context so it isn't recomputed per node. `meta.title` and
157
+ * `meta.description` are passed through the translator so callers can
158
+ * register translation keys as metadata — plain strings travel through
159
+ * unchanged.
157
160
  * @param metadataById
161
+ * @param translator
158
162
  */
159
- function createPrimitiveOptions(metadataById) {
163
+ function createPrimitiveOptions(metadataById, translator) {
160
164
  return [...metadataById.values()]
161
- .map((meta) => {
162
- var _a, _b;
163
- return ({
164
- value: meta.id,
165
- text: (_a = meta.title) !== null && _a !== void 0 ? _a : meta.id,
166
- secondaryText: (_b = meta.description) !== null && _b !== void 0 ? _b : '',
167
- icon: meta.icon,
168
- });
169
- })
165
+ .map((meta) => ({
166
+ value: meta.id,
167
+ text: meta.title ? translator.get(meta.title) : meta.id,
168
+ secondaryText: meta.description
169
+ ? translator.get(meta.description)
170
+ : '',
171
+ icon: meta.icon,
172
+ }))
170
173
  .sort((a, b) => a.text.localeCompare(b.text));
171
174
  }
172
175
  /**
@@ -547,7 +550,7 @@ const RuleEditor = class {
547
550
  var _a, _b, _c;
548
551
  const metadata = (_c = (_b = (_a = this.ruleRegistry).listMetadata) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];
549
552
  this.metadataById = new Map(metadata.map((item) => [item.id, item]));
550
- this.primitiveOptions = createPrimitiveOptions(this.metadataById);
553
+ this.primitiveOptions = createPrimitiveOptions(this.metadataById, this.platform.get(n.Translate));
551
554
  }
552
555
  runValidation() {
553
556
  if (!this.value) {
@@ -29,9 +29,18 @@ const RuleGate = class {
29
29
  this.shouldRender = true;
30
30
  return;
31
31
  }
32
- const compiled = this.ruleRegistry.compile(this.rule);
33
- const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
34
- this.shouldRender = compiled(scope);
32
+ try {
33
+ const compiled = this.ruleRegistry.compile(this.rule);
34
+ const scope = (_a = this.scope) !== null && _a !== void 0 ? _a : this.ruleRegistry.scope({ host: this.host });
35
+ this.shouldRender = compiled(scope);
36
+ }
37
+ catch (error) {
38
+ console.warn('rule-gate failed to compile rule; hiding slot', {
39
+ rule: this.rule,
40
+ error,
41
+ });
42
+ this.shouldRender = false;
43
+ }
35
44
  }
36
45
  get host() { return getElement(this); }
37
46
  static get watchers() { return {
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-BIwHMk6j.js";export{s as setNonce}from"./p-BIwHMk6j.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-49b8a9ca",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-beae8aa1",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-3252e153",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-62b247c1",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-2a05b949",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-c6a913af",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-47799e80",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-006b6449",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-a634c792",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-2cb31064",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-c609b5ec",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-b2383e7f",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-a3439b73",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-25436356",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"required":[516],"readonly":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"],"issues":[32],"openChipPath":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-8d3fa274",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-b978301b",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-1747221f",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-861ac606",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-9ccd9d7f",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-993991af",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-610dae2e",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-20206710",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-ef62c7d8",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-c3a72b03",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-1428aa13",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-dabb227b",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-bec4231f",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-32f8477f",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-3263f8d5",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-d1c61830",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-89170cc9",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-9f03e766",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-de6f4670",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-ea461bb7",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-6093254e",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-d33efebb",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-184ae23d",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-c43dc121",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-1955495c",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-e1e1e2d1",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-6cceabf1",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-4446f170",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d2a01f51",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-7975c91f",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-0c572fe9",[[1,"limebb-live-docs-info"]]],["p-92738a30",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-7ace2e41",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-c0128922",[[1,"limebb-rule-chip-popover",{"platform":[16],"context":[16],"refNode":[16],"isNegated":[4,"is-negated"],"metadata":[16],"readonly":[4],"disabled":[4],"isMutable":[4,"is-mutable"]}]]],["p-e468e359",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-10ddd002",[[1,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-731820f0",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-25234f4b",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-99054b73",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-7fee7ef3",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-d026068f",[[1,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-9f7992b0",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-99790629",[[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"value":[32]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
1
+ import{p as e,b as t}from"./p-BIwHMk6j.js";export{s as setNonce}from"./p-BIwHMk6j.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,l={};return""!==t&&(l.resourcesUrl=new URL(".",t).href),e(l)})().then((async e=>(await l(),t(JSON.parse('[["p-49b8a9ca",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32],"description":[32]}]]],["p-beae8aa1",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":[{"highlightedItemIdChanged":0}]}]]],["p-3252e153",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-62b247c1",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":[{"handleItemsChange":0}],"order":[{"handleItemsChange":0}]}]]],["p-2a05b949",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"helperText":[1,"helper-text"],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-c6a913af",[[1,"limebb-document-chips",{"accessibleLabel":[513,"accessible-label"],"files":[16]},null,{"files":[{"onFilesChanged":0}]}]]],["p-47799e80",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-006b6449",[[17,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":[{"watchOpen":0}],"editorPickerQuery":[{"watchQuery":0}]}]]],["p-a634c792",[[1,"limebb-data-cells",{"platform":[16],"context":[16],"limeobject":[8],"items":[16],"image":[16],"relativeDates":[4,"relative-dates"]}]]],["p-2cb31064",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-c609b5ec",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-b2383e7f",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-a3439b73",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":[{"handleItemsChange":0}]}]]],["p-30778dac",[[1,"limebb-rule-editor",{"platform":[16],"context":[16],"value":[16],"availableContexts":[16],"required":[516],"readonly":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"],"issues":[32],"openChipPath":[32]},null,{"value":[{"onValueChange":0}],"availableContexts":[{"onAvailableContextsChange":0}]}]]],["p-8d3fa274",[[257,"limebb-alert-dialog",{"type":[513],"open":[516],"icon":[513],"heading":[513],"subheading":[1]}]]],["p-b978301b",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-1747221f",[[1,"limebb-color-palette-picker",{"value":[513],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"label":[513],"helperText":[1,"helper-text"]}]]],["p-861ac606",[[1,"limebb-color-palette-swatches",{"colors":[16]}]]],["p-9ccd9d7f",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":[{"watchFormInfo":0}],"configComponent":[{"watchconfigComponent":0}]}]]],["p-993991af",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-610dae2e",[[257,"limebb-composer-toolbar",{"platform":[16],"mentions":[516],"textSnippets":[516,"text-snippets"],"internalLinks":[516,"internal-links"],"richText":[516,"rich-text"],"fileInput":[16]}]]],["p-20206710",[[257,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-ef62c7d8",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-c3a72b03",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32],"limetypes":[32]},null,{"filterId":[{"watchFilterId":0}],"propertyName":[{"watchPropertyName":0}],"aggregateOperator":[{"watchAggregateOperator":0}]}]]],["p-1428aa13",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-dabb227b",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-bec4231f",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-32f8477f",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-3263f8d5",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-d1c61830",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-89170cc9",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-9f03e766",[[257,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-de6f4670",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-ea461bb7",[[1,"limebb-object-chip",{"limetype":[1],"objectid":[2],"size":[1],"platform":[16],"data":[32]},null,{"limetype":[{"handlePropChange":0}],"objectid":[{"handlePropChange":0}]}]]],["p-de23d221",[[257,"limebb-rule-gate",{"platform":[16],"rule":[16],"scope":[16],"shouldRender":[32]},null,{"rule":[{"onRuleChange":0}],"scope":[{"onScopeChange":0}]}]]],["p-d33efebb",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":[{"valueChanged":0}]}]]],["p-184ae23d",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-c43dc121",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-1955495c",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-e1e1e2d1",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-6cceabf1",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513],"fileTypes":[16]}]]],["p-4446f170",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d2a01f51",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":[{"watchOpen":0}]}]]],["p-7975c91f",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-0c572fe9",[[1,"limebb-live-docs-info"]]],["p-92738a30",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-7ace2e41",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":[{"valueChanged":0}]}]]],["p-65ea94b4",[[1,"limebb-rule-chip-popover",{"platform":[16],"context":[16],"refNode":[16],"isNegated":[4,"is-negated"],"metadata":[16],"readonly":[4],"disabled":[4],"isMutable":[4,"is-mutable"]}]]],["p-e468e359",[[257,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-10ddd002",[[1,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-731820f0",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-25234f4b",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":[{"handleValueChange":0}]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-99054b73",[[1,"limebb-chat-icon-list",{"item":[16]}],[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-7fee7ef3",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-d026068f",[[1,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[513],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-9f7992b0",[[257,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"file":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-99790629",[[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"value":[32]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
@@ -1 +1 @@
1
- import{h as e,r as t,c as r}from"./p-BIwHMk6j.js";import{b as n}from"./p-D5qhls4G.js";function l(e,t){return t?{type:"not",rule:e}:e}function o(e,t){return e.length===t.length&&e.every(((e,r)=>e===t[r]))}function i(e,t){return e.filter((e=>o(e.path,t)))}function s(e,t){let r=e;for(const e of t)r=a(r,e);return r}function u(e,t,r){if(0===t.length)return r;const[n,...l]=t;if("not"===e.type&&"rule"===n)return Object.assign(Object.assign({},e),{rule:u(e.rule,l,r)});if(("all"===e.type||"any"===e.type)&&"rules"===n){if(0===l.length)return r;const[t,...n]=l;if("number"!=typeof t)return e;const o=[...e.rules];return o[t]=u(o[t],n,r),Object.assign(Object.assign({},e),{rules:o})}return e}function a(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const c={name:"question",color:"rgb(var(--color-glaucous-light))"};function d(e){return`__chip__:${e}`}function h(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const p=({groupNode:t,groupPath:r,chipChildren:n,ctx:l})=>{const o=new Map,i=n.map((e=>{const t=d(e.index);o.set(t,e);const r=(n=e.ref.id,null!==(i=l.primitiveOptions.find((e=>e.value===n)))&&void 0!==i?i:{value:n,text:n,icon:c});var n,i;return Object.assign(Object.assign({},r),{text:e.isNegated?`¬ ${r.text}`:r.text,value:t})})),s=(u=l.primitiveOptions,e=>Promise.resolve(function(e,t){if(!t)return e;const r=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>r.every((t=>{var r,n;return e.text.toLocaleLowerCase().includes(t)||(null===(r=e.secondaryText)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))||(null===(n=e.value)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))}))))}(u,e)));var u;const a=function(e,t,r){var n;const l=_(t,r);return null===l?null:null!==(n=e.find((e=>e.index===l)))&&void 0!==n?n:null}(n,r,l.openChipPath),h="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==a,openDirection:"bottom-start",onClose:l.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:l.translator.get("webclient.rule-editor.rules-label"),value:i,searcher:s,delimiter:h,readonly:l.readonly,disabled:l.disabled,onChange:f(t,r,o,l),onInteract:b(r,o,l)})),e("div",null,function(t,r,n){if(!t)return null;const l=function(e,t){return[...e,"rules",t]}(r,t.index);return e("limebb-rule-chip-popover",{platform:n.platform,context:n.context,refNode:t.ref,isNegated:t.isNegated,metadata:n.metadataById.get(t.ref.id),readonly:n.readonly,disabled:n.disabled,isMutable:n.isMutable,onNegate:v(t,l,n),onUpdateArgs:g(t,l,n),onDeleteChip:m(l,n)})}(a,r,l)))},f=(e,t,r,n)=>l=>{l.stopPropagation();const o=Array.isArray(l.detail)?l.detail:[],i=_(t,n.openChipPath);if(null!==i){const e=d(i);o.every((t=>t.value!==e))&&n.onPopoverClose()}const s=o.flatMap((e=>{if("string"!=typeof e.value)return[];const t=r.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===h(e)));n.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},b=(e,t,r)=>n=>{n.stopPropagation();const l=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(n.detail),o=l?t.get(l):void 0;o&&r.onChipInteract([...e,"rules",o.index])},v=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,n.detail?{type:"not",rule:e.ref}:e.ref)},g=(e,t,r)=>n=>{n.stopPropagation();const l=e.isNegated?[...t,"rule"]:t;r.onUpdateArgs(l,n.detail)},m=(e,t)=>()=>{t.onDelete(e)};function _(e,t){if(!t||t.length<2)return null;if(!o((r=t,r.slice(0,-2)),e))return null;var r;const n=t.at(-1);return"number"==typeof n?n:null}const y=({node:t,path:r,isNegated:n,ctx:l})=>{const o=n?[...r,"rule"]:r,s=n?[...i(l.issues,r),...i(l.issues,o)]:i(l.issues,r),u=[],a=[];for(const[e,r]of t.rules.entries()){const t=h(r);t?u.push(Object.assign(Object.assign({},t),{index:e})):a.push({child:r,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(l),d=c.find((e=>e.value===t.type));return e("div",{class:(f=t.type,b=s,{"rule-node":!0,[`rule-node--${f}`]:!0,"rule-node--invalid":b.length>0}),key:x(r)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!l.isMutable,onChange:C(t,r,n,l)}),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:l.translator.get("webclient.rule-editor.negate"),value:n,onChange:O(t,r,l)}),e("limel-icon-button",{icon:"trash",label:l.translator.get("webclient.rule-editor.delete"),onClick:()=>l.onDelete(r)})):null}(t,r,n,l)),e("div",{class:"rule-node__body"},e(z,{issues:s}),e(p,{groupNode:t,groupPath:o,chipChildren:u,ctx:l}),function(t,r,n){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(N,{node:t.child,path:[...r,"rules",t.index],ctx:n}))))}(a,o,l),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:l.translator.get("webclient.rule-editor.add-nested-group"),onClick:w(t,r,n,l)})):null}(t,r,n,l)));var f,b};function x(e){return 0===e.length?"root":e.join("/")}function j(e,t,r,n){n.onReplaceNode(t,l(e,r))}const C=(e,t,r,n)=>l=>{l.stopPropagation();const o=l.detail.value;o!==e.type&&j(Object.assign(Object.assign({},e),{type:o}),t,r,n)},w=(e,t,r,n)=>()=>{var l,o;j((l=e,o={type:"all",rules:[]},Object.assign(Object.assign({},l),{rules:[...l.rules,o]})),t,r,n)},O=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,l(e,n.detail))},N=t=>{const{node:r,path:n,ctx:l}=t,o=M(r);return o?e(y,{node:o.node,path:n,isNegated:o.isNegated,ctx:l}):null},k=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function M(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(k(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=M(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const z=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),A=class{constructor(e){t(this,e),this.change=r(this,"change"),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.primitiveOptions=[],this.normalizedCache=null,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const r=t.slice(0,-1),n=t.at(-1),l=s(e,r);if(("all"===l.type||"any"===l.type)&&"number"==typeof n){const t=[...l.rules];return t.splice(n,1),u(e,r,Object.assign(Object.assign({},l),{rules:t}))}return"not"===l.type&&"rule"===n?u(e,r,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,r){const n=s(e,t);return"ref"!==n.type?e:u(e,t,Object.assign(Object.assign({},n),{args:r}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,r){return u(e,t,r)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.indexMetadata(),this.runValidation()}componentDidLoad(){this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.runValidation()}render(){return e("div",{key:"8e0da39f6544c86de0143e91a6c48c9f2654315f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(N,{key:"cd093f5dc5a9b747036f581e6230f1205cf834e6",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,primitiveOptions:this.primitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.platform.get(n.Translate),openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,r;const n=null!==(r=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==r?r:[];this.metadataById=new Map(n.map((e=>[e.id,e]))),this.primitiveOptions=[...this.metadataById.values()].map((e=>{var t,r;return{value:e.id,text:null!==(t=e.title)&&void 0!==t?t:e.id,secondaryText:null!==(r=e.description)&&void 0!==r?r:"",icon:e.icon}})).sort(((e,t)=>e.text.localeCompare(t.text)))}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,this.availableContexts);this.issues=e.ok?[]:e.issues}emitIfChanged(e){var t;e!==this.normalizedValue&&this.change.emit("all"!==(t=e).type&&"any"!==t.type?t:0===t.rules.length?void 0:t)}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=(t=this.value)?M(t)?t:{type:"all",rules:[t]}:{type:"all",rules:[]};var t;return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}};A.style=":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}";export{A as limebb_rule_editor}
1
+ import{h as e,r as t,c as r}from"./p-BIwHMk6j.js";import{b as n}from"./p-D5qhls4G.js";function l(e,t){return t?{type:"not",rule:e}:e}function o(e,t){return e.length===t.length&&e.every(((e,r)=>e===t[r]))}function i(e,t){return e.filter((e=>o(e.path,t)))}function s(e,t){let r=e;for(const e of t)r=a(r,e);return r}function u(e,t,r){if(0===t.length)return r;const[n,...l]=t;if("not"===e.type&&"rule"===n)return Object.assign(Object.assign({},e),{rule:u(e.rule,l,r)});if(("all"===e.type||"any"===e.type)&&"rules"===n){if(0===l.length)return r;const[t,...n]=l;if("number"!=typeof t)return e;const o=[...e.rules];return o[t]=u(o[t],n,r),Object.assign(Object.assign({},e),{rules:o})}return e}function a(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const c={name:"question",color:"rgb(var(--color-glaucous-light))"};function d(e){return`__chip__:${e}`}function h(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const p=({groupNode:t,groupPath:r,chipChildren:n,ctx:l})=>{const o=new Map,i=n.map((e=>{const t=d(e.index);o.set(t,e);const r=(n=e.ref.id,null!==(i=l.primitiveOptions.find((e=>e.value===n)))&&void 0!==i?i:{value:n,text:n,icon:c});var n,i;return Object.assign(Object.assign({},r),{text:e.isNegated?`¬ ${r.text}`:r.text,value:t})})),s=(u=l.primitiveOptions,e=>Promise.resolve(function(e,t){if(!t)return e;const r=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>r.every((t=>{var r,n;return e.text.toLocaleLowerCase().includes(t)||(null===(r=e.secondaryText)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))||(null===(n=e.value)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))}))))}(u,e)));var u;const a=function(e,t,r){var n;const l=_(t,r);return null===l?null:null!==(n=e.find((e=>e.index===l)))&&void 0!==n?n:null}(n,r,l.openChipPath),h="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==a,openDirection:"bottom-start",onClose:l.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:l.translator.get("webclient.rule-editor.rules-label"),value:i,searcher:s,delimiter:h,readonly:l.readonly,disabled:l.disabled,onChange:f(t,r,o,l),onInteract:b(r,o,l)})),e("div",null,function(t,r,n){if(!t)return null;const l=function(e,t){return[...e,"rules",t]}(r,t.index);return e("limebb-rule-chip-popover",{platform:n.platform,context:n.context,refNode:t.ref,isNegated:t.isNegated,metadata:n.metadataById.get(t.ref.id),readonly:n.readonly,disabled:n.disabled,isMutable:n.isMutable,onNegate:v(t,l,n),onUpdateArgs:g(t,l,n),onDeleteChip:m(l,n)})}(a,r,l)))},f=(e,t,r,n)=>l=>{l.stopPropagation();const o=Array.isArray(l.detail)?l.detail:[],i=_(t,n.openChipPath);if(null!==i){const e=d(i);o.every((t=>t.value!==e))&&n.onPopoverClose()}const s=o.flatMap((e=>{if("string"!=typeof e.value)return[];const t=r.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===h(e)));n.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},b=(e,t,r)=>n=>{n.stopPropagation();const l=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(n.detail),o=l?t.get(l):void 0;o&&r.onChipInteract([...e,"rules",o.index])},v=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,n.detail?{type:"not",rule:e.ref}:e.ref)},g=(e,t,r)=>n=>{n.stopPropagation();const l=e.isNegated?[...t,"rule"]:t;r.onUpdateArgs(l,n.detail)},m=(e,t)=>()=>{t.onDelete(e)};function _(e,t){if(!t||t.length<2)return null;if(!o((r=t,r.slice(0,-2)),e))return null;var r;const n=t.at(-1);return"number"==typeof n?n:null}const y=({node:t,path:r,isNegated:n,ctx:l})=>{const o=n?[...r,"rule"]:r,s=n?[...i(l.issues,r),...i(l.issues,o)]:i(l.issues,r),u=[],a=[];for(const[e,r]of t.rules.entries()){const t=h(r);t?u.push(Object.assign(Object.assign({},t),{index:e})):a.push({child:r,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(l),d=c.find((e=>e.value===t.type));return e("div",{class:(f=t.type,b=s,{"rule-node":!0,[`rule-node--${f}`]:!0,"rule-node--invalid":b.length>0}),key:x(r)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!l.isMutable,onChange:C(t,r,n,l)}),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:l.translator.get("webclient.rule-editor.negate"),value:n,onChange:O(t,r,l)}),e("limel-icon-button",{icon:"trash",label:l.translator.get("webclient.rule-editor.delete"),onClick:()=>l.onDelete(r)})):null}(t,r,n,l)),e("div",{class:"rule-node__body"},e(z,{issues:s}),e(p,{groupNode:t,groupPath:o,chipChildren:u,ctx:l}),function(t,r,n){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(N,{node:t.child,path:[...r,"rules",t.index],ctx:n}))))}(a,o,l),function(t,r,n,l){return l.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:l.translator.get("webclient.rule-editor.add-nested-group"),onClick:w(t,r,n,l)})):null}(t,r,n,l)));var f,b};function x(e){return 0===e.length?"root":e.join("/")}function j(e,t,r,n){n.onReplaceNode(t,l(e,r))}const C=(e,t,r,n)=>l=>{l.stopPropagation();const o=l.detail.value;o!==e.type&&j(Object.assign(Object.assign({},e),{type:o}),t,r,n)},w=(e,t,r,n)=>()=>{var l,o;j((l=e,o={type:"all",rules:[]},Object.assign(Object.assign({},l),{rules:[...l.rules,o]})),t,r,n)},O=(e,t,r)=>n=>{n.stopPropagation(),r.onReplaceNode(t,l(e,n.detail))},N=t=>{const{node:r,path:n,ctx:l}=t,o=M(r);return o?e(y,{node:o.node,path:n,isNegated:o.isNegated,ctx:l}):null},k=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function M(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(k(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=M(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const z=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),A=class{constructor(e){t(this,e),this.change=r(this,"change"),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.primitiveOptions=[],this.normalizedCache=null,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const r=t.slice(0,-1),n=t.at(-1),l=s(e,r);if(("all"===l.type||"any"===l.type)&&"number"==typeof n){const t=[...l.rules];return t.splice(n,1),u(e,r,Object.assign(Object.assign({},l),{rules:t}))}return"not"===l.type&&"rule"===n?u(e,r,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,r){const n=s(e,t);return"ref"!==n.type?e:u(e,t,Object.assign(Object.assign({},n),{args:r}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,r){return u(e,t,r)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.indexMetadata(),this.runValidation()}componentDidLoad(){this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.runValidation()}render(){return e("div",{key:"8e0da39f6544c86de0143e91a6c48c9f2654315f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(N,{key:"cd093f5dc5a9b747036f581e6230f1205cf834e6",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,primitiveOptions:this.primitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.platform.get(n.Translate),openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,r;const l=null!==(r=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==r?r:[];var o,i;this.metadataById=new Map(l.map((e=>[e.id,e]))),this.primitiveOptions=(o=this.metadataById,i=this.platform.get(n.Translate),[...o.values()].map((e=>({value:e.id,text:e.title?i.get(e.title):e.id,secondaryText:e.description?i.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text))))}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,this.availableContexts);this.issues=e.ok?[]:e.issues}emitIfChanged(e){var t;e!==this.normalizedValue&&this.change.emit("all"!==(t=e).type&&"any"!==t.type?t:0===t.rules.length?void 0:t)}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=(t=this.value)?M(t)?t:{type:"all",rules:[t]}:{type:"all",rules:[]};var t;return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(n.RuleRegistry)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}};A.style=":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}";export{A as limebb_rule_editor}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as r}from"./p-BIwHMk6j.js";import{b as i}from"./p-D5qhls4G.js";import{L as o}from"./p-C_tMNOSt.js";const s=class{constructor(r){e(this,r),this.negate=t(this,"negate"),this.updateArgs=t(this,"updateArgs"),this.deleteChip=t(this,"deleteChip"),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return r("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,t,i,o;const s=(null===(e=this.metadata)||void 0===e?void 0:e.title)?this.translator.get(this.metadata.title):null!==(i=null===(t=this.refNode)||void 0===t?void 0:t.id)&&void 0!==i?i:"";return r("limel-header",{class:"popover__header is-narrow",heading:s,icon:null===(o=this.metadata)||void 0===o?void 0:o.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?r("div",{slot:"actions",class:"popover__header-actions"},r("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),r("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(i.Translate)}renderBody(){var e,t;const i=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return i?r("div",{class:"popover__body"},r(o,{platform:this.platform,context:this.context,name:i.name,props:Object.assign(Object.assign({},i.props),{value:null===(t=this.refNode)||void 0===t?void 0:t.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}};s.style=":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}";export{s as limebb_rule_chip_popover}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as s,g as i}from"./p-BIwHMk6j.js";import{b as o}from"./p-D5qhls4G.js";const h=class{constructor(e){t(this,e),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return e(s,{key:"365df6908301371b8b964671382ad936971b6624",hidden:!this.shouldRender},e("slot",{key:"ca7c2a9febf0189dfae882a2ae894d1d0262a213"}))}get ruleRegistry(){return this.platform.get(o.RuleRegistry)}compileAndEvaluate(){var t;if(this.rule)try{const e=this.ruleRegistry.compile(this.rule),s=null!==(t=this.scope)&&void 0!==t?t:this.ruleRegistry.scope({host:this.host});this.shouldRender=e(s)}catch(t){console.warn("rule-gate failed to compile rule; hiding slot",{rule:this.rule,error:t}),this.shouldRender=!1}else this.shouldRender=!0}get host(){return i(this)}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}};h.style=":host{display:contents}:host([hidden]){display:none}";export{h as limebb_rule_gate}
@@ -1,5 +1,5 @@
1
1
  import { LimelPickerCustomEvent, ListItem } from '@limetech/lime-elements';
2
- import { PrimitiveMetadata, RuleValidationIssue } from '@limetech/lime-web-components';
2
+ import { PrimitiveMetadata, RuleValidationIssue, Translator } from '@limetech/lime-web-components';
3
3
  /**
4
4
  * Event emitted by `limel-picker` when its value changes. Single-select
5
5
  * pickers receive a single item, multi-select pickers receive an array.
@@ -19,10 +19,14 @@ export type PickerInteractEvent = LimelPickerCustomEvent<ListItem<string>>;
19
19
  export declare function nodeClasses(type: 'all' | 'any', issues: RuleValidationIssue[]): Record<string, boolean>;
20
20
  /**
21
21
  * Build the searchable list shown by the primitive pickers. Cached on
22
- * the render context so it isn't recomputed per node.
22
+ * the render context so it isn't recomputed per node. `meta.title` and
23
+ * `meta.description` are passed through the translator so callers can
24
+ * register translation keys as metadata — plain strings travel through
25
+ * unchanged.
23
26
  * @param metadataById
27
+ * @param translator
24
28
  */
25
- export declare function createPrimitiveOptions(metadataById: Map<string, PrimitiveMetadata>): Array<ListItem<string>>;
29
+ export declare function createPrimitiveOptions(metadataById: Map<string, PrimitiveMetadata>, translator: Translator): Array<ListItem<string>>;
26
30
  /**
27
31
  * Find the picker item for `id`, falling back to a placeholder marked
28
32
  * with the unknown-primitive icon when the id isn't in the registry.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "1.126.1",
3
+ "version": "1.126.3",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "@limetech/lime-elements": "^39.25.0",
39
39
  "@limetech/lime-web-components": "^6.23.0",
40
40
  "@lundalogik/lime-icons8": "^2.40.1",
41
- "@lundalogik/limeclient.js": "^1.101.0",
41
+ "@lundalogik/limeclient.js": "^1.102.1",
42
42
  "@stencil/core": "^4.43.4",
43
43
  "@stencil/sass": "^3.1.9",
44
44
  "@types/jest": "^29.5.14",
@@ -1 +0,0 @@
1
- import{r as t,h as s,H as e,g as i}from"./p-BIwHMk6j.js";import{b as o}from"./p-D5qhls4G.js";const h=class{constructor(s){t(this,s),this.shouldRender=!1}componentWillLoad(){this.compileAndEvaluate()}onRuleChange(){this.compileAndEvaluate()}onScopeChange(){this.compileAndEvaluate()}render(){return s(e,{key:"365df6908301371b8b964671382ad936971b6624",hidden:!this.shouldRender},s("slot",{key:"ca7c2a9febf0189dfae882a2ae894d1d0262a213"}))}get ruleRegistry(){return this.platform.get(o.RuleRegistry)}compileAndEvaluate(){var t;if(!this.rule)return void(this.shouldRender=!0);const s=this.ruleRegistry.compile(this.rule),e=null!==(t=this.scope)&&void 0!==t?t:this.ruleRegistry.scope({host:this.host});this.shouldRender=s(e)}get host(){return i(this)}static get watchers(){return{rule:[{onRuleChange:0}],scope:[{onScopeChange:0}]}}};h.style=":host{display:contents}:host([hidden]){display:none}";export{h as limebb_rule_gate}
@@ -1 +0,0 @@
1
- import{r as e,c as r,h as t}from"./p-BIwHMk6j.js";import{b as o}from"./p-D5qhls4G.js";import{L as i}from"./p-C_tMNOSt.js";const s=class{constructor(t){e(this,t),this.negate=r(this,"negate"),this.updateArgs=r(this,"updateArgs"),this.deleteChip=r(this,"deleteChip"),this.isNegated=!1,this.readonly=!1,this.disabled=!1,this.isMutable=!0,this.handleNegateChange=e=>{e.stopPropagation(),this.negate.emit(e.detail)},this.handleArgsChange=e=>{e.stopPropagation(),this.updateArgs.emit(e.detail)},this.handleDelete=()=>{this.deleteChip.emit()}}render(){return t("div",{key:"6aae573b524737ee3d2a4b2d3df68ec9bf1f1a0f",class:"popover"},this.renderHeader(),this.renderBody())}renderHeader(){var e,r,o,i,s;const a=null!==(i=null!==(r=null===(e=this.metadata)||void 0===e?void 0:e.title)&&void 0!==r?r:null===(o=this.refNode)||void 0===o?void 0:o.id)&&void 0!==i?i:"";return t("limel-header",{class:"popover__header is-narrow",heading:a,icon:null===(s=this.metadata)||void 0===s?void 0:s.icon},this.renderHeaderActions())}renderHeaderActions(){return this.isMutable?t("div",{slot:"actions",class:"popover__header-actions"},t("limel-switch",{class:"popover__negate-switch",label:this.translator.get("webclient.rule-editor.negate"),value:this.isNegated,onChange:this.handleNegateChange}),t("limel-icon-button",{class:"popover__delete-button",icon:"trash",label:this.translator.get("webclient.rule-editor.delete"),onClick:this.handleDelete})):null}get translator(){return this.platform.get(o.Translate)}renderBody(){var e,r;const o=null===(e=this.metadata)||void 0===e?void 0:e.configComponent;return o?t("div",{class:"popover__body"},t(i,{platform:this.platform,context:this.context,name:o.name,props:Object.assign(Object.assign({},o.props),{value:null===(r=this.refNode)||void 0===r?void 0:r.args,readonly:this.readonly,disabled:this.disabled,onChange:this.handleArgsChange})})):null}};s.style=":host{display:block}.popover{display:flex;flex-direction:column;min-width:24rem;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-700));border-radius:0.5rem;box-shadow:0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);overflow:hidden}.popover__header{--header-background-color:rgba(var(--contrast-300));padding-right:0.5rem;gap:1rem}.popover__header-actions{display:grid;grid-auto-flow:column;grid-gap:0.75rem;padding:0.25rem;align-items:center}.popover__delete-button{color:rgb(var(--contrast-1100))}.popover__body{padding:1rem}";export{s as limebb_rule_chip_popover}