@nyaruka/temba-components 0.93.2 → 0.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.94.0](https://github.com/nyaruka/temba-components/compare/v0.93.3...v0.94.0)
8
+
9
+ - Improvements to contact search [`#437`](https://github.com/nyaruka/temba-components/pull/437)
10
+ - Show contact search exclusions as filters [`98cf90e`](https://github.com/nyaruka/temba-components/commit/98cf90e74a5ca4017998c52284251ddf07268b4a)
11
+ - Allow filter by various activity levels [`8928b7b`](https://github.com/nyaruka/temba-components/commit/8928b7bf3bd018fa53ec1a9c3e4f8b551d4289d6)
12
+
13
+ #### [v0.93.3](https://github.com/nyaruka/temba-components/compare/v0.93.2...v0.93.3)
14
+
15
+ > 21 June 2024
16
+
17
+ - More z-index tweaks [`a416b7d`](https://github.com/nyaruka/temba-components/commit/a416b7d8ea7499a508e7ce60886c54d39335c2b5)
18
+
7
19
  #### [v0.93.2](https://github.com/nyaruka/temba-components/compare/v0.93.1...v0.93.2)
8
20
 
21
+ > 21 June 2024
22
+
9
23
  - Fix z-index interfence on message popups [`99a22e2`](https://github.com/nyaruka/temba-components/commit/99a22e264d458a2db6b334d5b9a5b2473f76ec31)
10
24
 
11
25
  #### [v0.93.1](https://github.com/nyaruka/temba-components/compare/v0.93.0...v0.93.1)
@@ -4,11 +4,8 @@
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
6
  scf1453991c986b25: `Tab para completar, enter para seleccionar`,
7
- sf8653793d61d060c: `Skip inactive contacts`,
8
- sd4af861b95e8ba4a: `Only include contacts who have sent a message in the last 90 days.`,
9
- sd149dff460c8dc41: `Skip contacts currently in a flow`,
10
- sc85010c81b71421e: `Avoid interrupting a contact who is already in a flow.`,
11
- s3e3fa53e834f4fda: `Skip repeat contacts`,
12
- s95e715d82602bced: `Avoid restarting a contact who has been in this flow in the last 90 days.`
7
+ s638236250662c6b3: `Have sent a message in the last`,
8
+ s8f02e3a18ffc083a: `Are not currently in a flow`,
9
+ s4788ee206c4570c7: `Have not started this flow in the last 90 days`
13
10
  };
14
11
  //# sourceMappingURL=es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,4CAA4C;IAC/D,iBAAiB,EAAE,wBAAwB;IAC3C,iBAAiB,EAAE,oEAAoE;IACvF,iBAAiB,EAAE,mCAAmC;IACtD,iBAAiB,EAAE,wDAAwD;IAC3E,iBAAiB,EAAE,sBAAsB;IACzC,iBAAiB,EAAE,2EAA2E;CAC/F,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab para completar, enter para seleccionar`,\n sf8653793d61d060c: `Skip inactive contacts`,\n sd4af861b95e8ba4a: `Only include contacts who have sent a message in the last 90 days.`,\n sd149dff460c8dc41: `Skip contacts currently in a flow`,\n sc85010c81b71421e: `Avoid interrupting a contact who is already in a flow.`,\n s3e3fa53e834f4fda: `Skip repeat contacts`,\n s95e715d82602bced: `Avoid restarting a contact who has been in this flow in the last 90 days.`\n};\n"]}
1
+ {"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,4CAA4C;IAC/D,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab para completar, enter para seleccionar`,\n s638236250662c6b3: `Have sent a message in the last`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -4,11 +4,8 @@
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
6
  scf1453991c986b25: `Tab to complete, enter to select`,
7
- sf8653793d61d060c: `Skip inactive contacts`,
8
- sd4af861b95e8ba4a: `Only include contacts who have sent a message in the last 90 days.`,
9
- sd149dff460c8dc41: `Skip contacts currently in a flow`,
10
- sc85010c81b71421e: `Avoid interrupting a contact who is already in a flow.`,
11
- s3e3fa53e834f4fda: `Skip repeat contacts`,
12
- s95e715d82602bced: `Avoid restarting a contact who has been in this flow in the last 90 days.`
7
+ s638236250662c6b3: `Have sent a message in the last`,
8
+ s8f02e3a18ffc083a: `Are not currently in a flow`,
9
+ s4788ee206c4570c7: `Have not started this flow in the last 90 days`
13
10
  };
14
11
  //# sourceMappingURL=fr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,wBAAwB;IAC3C,iBAAiB,EAAE,oEAAoE;IACvF,iBAAiB,EAAE,mCAAmC;IACtD,iBAAiB,EAAE,wDAAwD;IAC3E,iBAAiB,EAAE,sBAAsB;IACzC,iBAAiB,EAAE,2EAA2E;CAC/F,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n sf8653793d61d060c: `Skip inactive contacts`,\n sd4af861b95e8ba4a: `Only include contacts who have sent a message in the last 90 days.`,\n sd149dff460c8dc41: `Skip contacts currently in a flow`,\n sc85010c81b71421e: `Avoid interrupting a contact who is already in a flow.`,\n s3e3fa53e834f4fda: `Skip repeat contacts`,\n s95e715d82602bced: `Avoid restarting a contact who has been in this flow in the last 90 days.`\n};\n"]}
1
+ {"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s638236250662c6b3: `Have sent a message in the last`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -4,11 +4,8 @@
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
6
  scf1453991c986b25: `Tab to complete, enter to select`,
7
- sf8653793d61d060c: `Skip inactive contacts`,
8
- sd4af861b95e8ba4a: `Only include contacts who have sent a message in the last 90 days.`,
9
- sd149dff460c8dc41: `Skip contacts currently in a flow`,
10
- sc85010c81b71421e: `Avoid interrupting a contact who is already in a flow.`,
11
- s3e3fa53e834f4fda: `Skip repeat contacts`,
12
- s95e715d82602bced: `Avoid restarting a contact who has been in this flow in the last 90 days.`
7
+ s638236250662c6b3: `Have sent a message in the last`,
8
+ s8f02e3a18ffc083a: `Are not currently in a flow`,
9
+ s4788ee206c4570c7: `Have not started this flow in the last 90 days`
13
10
  };
14
11
  //# sourceMappingURL=pt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,wBAAwB;IAC3C,iBAAiB,EAAE,oEAAoE;IACvF,iBAAiB,EAAE,mCAAmC;IACtD,iBAAiB,EAAE,wDAAwD;IAC3E,iBAAiB,EAAE,sBAAsB;IACzC,iBAAiB,EAAE,2EAA2E;CAC/F,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n sf8653793d61d060c: `Skip inactive contacts`,\n sd4af861b95e8ba4a: `Only include contacts who have sent a message in the last 90 days.`,\n sd149dff460c8dc41: `Skip contacts currently in a flow`,\n sc85010c81b71421e: `Avoid interrupting a contact who is already in a flow.`,\n s3e3fa53e834f4fda: `Skip repeat contacts`,\n s95e715d82602bced: `Avoid restarting a contact who has been in this flow in the last 90 days.`\n};\n"]}
1
+ {"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s638236250662c6b3: `Have sent a message in the last`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -1872,6 +1872,8 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
1872
1872
  display: flex;
1873
1873
  flex-direction: column;
1874
1874
  flex-grow: 1;
1875
+ position: relative;
1876
+ z-index: 1;
1875
1877
  }
1876
1878
 
1877
1879
  .block {
@@ -2258,6 +2260,7 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
2258
2260
  opacity: 0;
2259
2261
  transform: scale(0.7);
2260
2262
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
2263
+ z-index: 2;
2261
2264
  }
2262
2265
 
2263
2266
  .popup .arrow {
@@ -2728,7 +2731,38 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
2728
2731
  temba-alert {
2729
2732
  margin: 1em 0;
2730
2733
  }
2731
- `}refresh(){this.refreshKey="requested_"+(new Date).getTime()}updated(t){super.updated(t),t.has("advanced")&&this.advanced||(t.has("in_a_flow")&&!this.in_a_flow&&(delete this.exclusions.in_a_flow,this.requestUpdate("exclusions")),(t.has("query")&&this.advanced||t.has("refreshKey")&&"0"!==this.refreshKey)&&(this.summary=null,this.fireCustomEvent(Oe.ContentChanged,{reset:!0}),this.lastQuery&&(window.clearTimeout(this.lastQuery),this.fetching=!1),(this.query.trim().length>0||this.recipients.length>0)&&(this.fetching=!0,this.lastQuery=window.setTimeout((()=>{this.fetchSummary()}),2e3))))}fetchSummary(){if(this.endpoint){const t=this.recipients.filter((t=>"group"===t.type)).map((t=>t.id)),e=this.recipients.filter((t=>"contact"===t.type)).map((t=>t.id));Kt(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,200===t.status?(this.summary=t.json,this.advanced||(this.query=this.summary.query),this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients}),this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent(Oe.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(Oe.ContentChanged,this.summary))}))}}handleAdvancedToggle(t){re(t),this.recipients=[],this.exclusions={},this.advanced&&(this.query="",this.value=null),this.advanced=!this.advanced,this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients})}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleRecipientsChanged(){"0"!==this.refreshKey||this.initialized?this.refresh():this.initialized=!0}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let o=i.checked;o?("not_seen_since_days"===i.name&&(o=90),this.exclusions[i.name]=o):delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=j`
2734
+
2735
+ temba-select[name='not_seen_since_days'] {
2736
+ margin-bottom: 1em;
2737
+ display: block;
2738
+ }
2739
+
2740
+ .activity-select {
2741
+ display: flex;
2742
+ align-items: center;
2743
+ padding: var(--checkbox-padding, 10px);
2744
+ border-radius: var(--curvature);
2745
+ cursor: pointer;
2746
+ }
2747
+
2748
+ .activity-select:hover {
2749
+ background: #f9f9f9;
2750
+ }
2751
+
2752
+ .small-select {
2753
+ --temba-select-selected-padding: 0px 0.5em;
2754
+ --temba-select-selected-line-height: 1em;
2755
+ --temba-select-selected-font-size: 1em;
2756
+ --search-input-height: 0px !important;
2757
+ min-width: 100px;
2758
+ }
2759
+
2760
+ .filters {
2761
+ padding: 1em;
2762
+ border: 1px solid var(--color-borders);
2763
+ border-radius: var(--curvature);
2764
+ }
2765
+ `}refresh(){this.refreshKey="requested_"+(new Date).getTime()}updated(t){super.updated(t),t.has("advanced")&&this.advanced||(t.has("in_a_flow")&&!this.in_a_flow&&(delete this.exclusions.in_a_flow,this.requestUpdate("exclusions")),(t.has("query")&&this.advanced||t.has("refreshKey")&&"0"!==this.refreshKey)&&(this.summary=null,this.fireCustomEvent(Oe.ContentChanged,{reset:!0}),this.lastQuery&&(window.clearTimeout(this.lastQuery),this.fetching=!1),(this.query.trim().length>0||this.recipients.length>0)&&(this.fetching=!0,this.lastQuery=window.setTimeout((()=>{this.fetchSummary()}),2e3))))}fetchSummary(){if(this.endpoint){const t=this.recipients.filter((t=>"group"===t.type)).map((t=>t.id)),e=this.recipients.filter((t=>"contact"===t.type)).map((t=>t.id));Kt(this.endpoint,{include:this.advanced?{query:this.query}:{contact_uuids:e,group_uuids:t},exclude:this.exclusions}).then((t=>{this.fetching=!1,200===t.status?(this.summary=t.json,this.advanced||(this.query=this.summary.query),this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients}),this.summary.error?this.errors=[this.summary.error]:this.errors=[],this.requestUpdate("errors"),this.fireCustomEvent(Oe.ContentChanged,this.summary)):(this.summary=t.json,this.summary.error&&(this.errors=[this.summary.error]),this.requestUpdate("errors"),this.fireCustomEvent(Oe.ContentChanged,this.summary))}))}}handleAdvancedToggle(t){re(t),this.recipients=[],this.exclusions={},this.advanced&&(this.query="",this.value=null),this.advanced=!this.advanced,this.setValue({advanced:this.advanced,query:this.query,exclusions:this.exclusions,recipients:this.recipients})}handleQueryChange(t){const e=t.target;this.query=e.inputElement.value}handleRecipientsChanged(){"0"!==this.refreshKey||this.initialized?this.refresh():this.initialized=!0}handleActivityLevelChanged(t){const e=t.target.values[0];e&&this.exclusions.not_seen_since_days&&(this.exclusions.not_seen_since_days=parseInt(e.value),this.refresh())}handleActivityLabelClicked(t){if(t.target&&"TEMBA-CHECKBOX"!==t.target.tagName&&"TEMBA-SELECT"!==t.target.tagName&&!t.target.disabled){const e=t.currentTarget.querySelector("temba-checkbox");e.checked=!e.checked}}handleExclusionChanged(t){if("TEMBA-CHECKBOX"===t.target.tagName){const e=JSON.stringify(this.exclusions),i=t.target;let o=i.checked;if("not_seen_since_days"===i.name&&o){const t=i.parentElement.querySelector("temba-select");t.values[0]&&(o=parseInt(t.values[0].value))}o?this.exclusions[i.name]=o:delete this.exclusions[i.name],e!==JSON.stringify(this.exclusions)&&this.refresh()}}render(){let t;if(this.summary&&!this.summary.error){const e=this.summary.total||0;t=j`
2732
2766
  <div class="result-count">
2733
2767
  Found
2734
2768
  <a
@@ -2763,57 +2797,93 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
2763
2797
  </temba-button>
2764
2798
  `}return this.summary&&this.summary.blockers&&this.summary.blockers.length>0?j`${this.summary.blockers.map((t=>j`<temba-alert level="error">${pr(t)}</temba-alert>`))}`:j`
2765
2799
  ${this.advanced?j`<div class="query">
2766
- <temba-textinput
2767
- .label=${this.label}
2768
- .helpText=${this.helpText}
2769
- .widgetOnly=${this.widgetOnly}
2770
- .errors=${this.errors}
2771
- name=${this.name}
2772
- .inputRoot=${this}
2773
- @input=${this.handleQueryChange}
2774
- placeholder=${this.placeholder}
2775
- .value=${this.query}
2776
- textarea
2777
- autogrow
2778
- >
2779
- </temba-textinput>
2780
- </div>`:j`<temba-omnibox
2781
- placeholder="Search for contacts or groups"
2782
- widget_only=""
2783
- groups=""
2784
- contacts=""
2785
- label="Recipients"
2786
- help_text="The contacts to send the message to."
2787
- .errors=${this.errors}
2788
- id="recipients"
2789
- name="recipients"
2790
- .value=${this.recipients}
2791
- endpoint="/contact/omnibox/?"
2792
- @change=${this.handleRecipientsChanged}
2793
- >
2794
- </temba-omnibox>
2795
-
2796
- ${this.not_seen_since_days?j`<temba-checkbox
2797
- name="not_seen_since_days"
2798
- label="${ir("Skip inactive contacts")}"
2799
- help_text="${ir("Only include contacts who have sent a message in the last 90 days.")}"
2800
- ?checked=${90===this.exclusions.not_seen_since_days}
2801
- @change=${this.handleExclusionChanged}
2802
- ></temba-checkbox>`:null}
2803
- ${this.in_a_flow?j`<temba-checkbox
2804
- name="in_a_flow"
2805
- label="${ir("Skip contacts currently in a flow")}"
2806
- help_text="${ir("Avoid interrupting a contact who is already in a flow.")}"
2807
- ?checked=${this.exclusions.in_a_flow}
2808
- @change=${this.handleExclusionChanged}
2809
- ></temba-checkbox>`:null}
2810
- ${this.started_previously?j`<temba-checkbox
2811
- name="started_previously"
2812
- label="${ir("Skip repeat contacts")}"
2813
- help_text="${ir("Avoid restarting a contact who has been in this flow in the last 90 days.")}"
2814
- ?checked=${this.exclusions.started_previously}
2815
- @change=${this.handleExclusionChanged}
2816
- ></temba-checkbox>`:null}`}
2800
+ <temba-textinput
2801
+ .label=${this.label}
2802
+ .helpText=${this.helpText}
2803
+ .widgetOnly=${this.widgetOnly}
2804
+ .errors=${this.errors}
2805
+ name=${this.name}
2806
+ .inputRoot=${this}
2807
+ @input=${this.handleQueryChange}
2808
+ placeholder=${this.placeholder}
2809
+ .value=${this.query}
2810
+ textarea
2811
+ autogrow
2812
+ >
2813
+ </temba-textinput>
2814
+ </div>`:j`<temba-omnibox
2815
+ placeholder="Search for contacts or groups"
2816
+ widget_only=""
2817
+ groups=""
2818
+ contacts=""
2819
+ label="Recipients"
2820
+ help_text="The contacts to send the message to."
2821
+ .errors=${this.errors}
2822
+ id="recipients"
2823
+ name="recipients"
2824
+ .value=${this.recipients}
2825
+ endpoint="/contact/omnibox/?"
2826
+ @change=${this.handleRecipientsChanged}
2827
+ >
2828
+ </temba-omnibox>
2829
+
2830
+ <div class="filters">
2831
+ <div style="display:flex;font-size:1em;margin-bottom:0.5em">
2832
+ <temba-icon size="1" name="filter"></temba-icon>
2833
+ <div style="margin-left:0.5em">
2834
+ Only include contacts who...
2835
+ </div>
2836
+ </div>
2837
+
2838
+ ${this.not_seen_since_days?j`
2839
+ <div
2840
+ class="activity-select"
2841
+ @click=${this.handleActivityLabelClicked}
2842
+ >
2843
+ <temba-checkbox
2844
+ style="display:inline;"
2845
+ name="not_seen_since_days"
2846
+ @change=${this.handleExclusionChanged}
2847
+ >
2848
+ </temba-checkbox>
2849
+
2850
+ <div style="margin-left:0.5em">
2851
+ ${ir("Have sent a message in the last")}
2852
+ </div>
2853
+
2854
+ <temba-select
2855
+ style="margin-left:0.5em"
2856
+ class="small-select"
2857
+ @change=${this.handleActivityLevelChanged}
2858
+ ?disabled=${!this.exclusions.not_seen_since_days}
2859
+ >
2860
+ <temba-option
2861
+ name="90 days"
2862
+ value="90"
2863
+ ></temba-option>
2864
+ <temba-option
2865
+ name="180 days"
2866
+ value="180"
2867
+ ></temba-option>
2868
+ <temba-option name="Year" value="365"></temba-option>
2869
+ </temba-select>
2870
+ <div></div>
2871
+ </div>
2872
+ `:null}
2873
+ ${this.in_a_flow?j`<temba-checkbox
2874
+ name="in_a_flow"
2875
+ label="${ir("Are not currently in a flow")}"
2876
+ ?checked=${this.exclusions.in_a_flow}
2877
+ @change=${this.handleExclusionChanged}
2878
+ ></temba-checkbox>`:null}
2879
+ ${this.started_previously?j`<temba-checkbox
2880
+ name="started_previously"
2881
+ label="${ir("Have not started this flow in the last 90 days")}"
2882
+ ?checked=${this.exclusions.started_previously}
2883
+ @change=${this.handleExclusionChanged}
2884
+ ></temba-checkbox>`:null}
2885
+ </div>`}
2886
+ </div>
2817
2887
 
2818
2888
  <div
2819
2889
  class="results ${Vt({fetching:this.fetching,initialized:this.initialized||this.fetching,empty:(this.summary&&this.summary.error||!this.summary)&&!this.fetching})}"
@@ -2823,8 +2893,8 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
2823
2893
  </div>
2824
2894
 
2825
2895
  ${this.summary&&this.summary.warnings?this.summary.warnings.map((t=>j`<temba-alert level="warning"
2826
- >${pr(t)}</temba-alert
2827
- >`)):""}
2896
+ >${pr(t)}</temba-alert
2897
+ >`)):""}
2828
2898
  `}}t([ge({type:Boolean})],Yl.prototype,"in_a_flow",void 0),t([ge({type:Boolean})],Yl.prototype,"started_previously",void 0),t([ge({type:Boolean})],Yl.prototype,"not_seen_since_days",void 0),t([ge({type:Boolean})],Yl.prototype,"fetching",void 0),t([ge({type:Boolean})],Yl.prototype,"expanded",void 0),t([ge({type:String})],Yl.prototype,"endpoint",void 0),t([ge({type:String})],Yl.prototype,"placeholder",void 0),t([ge({type:String})],Yl.prototype,"name",void 0),t([ge({type:String})],Yl.prototype,"query",void 0),t([ge({type:Number})],Yl.prototype,"inactiveThreshold",void 0),t([ge({type:Number})],Yl.prototype,"inactiveDays",void 0),t([ge({type:Object,attribute:!1})],Yl.prototype,"summary",void 0),t([ge({type:Object,attribute:!1})],Yl.prototype,"flow",void 0),t([ge({type:Array})],Yl.prototype,"recipients",void 0),t([ge({type:Boolean})],Yl.prototype,"advanced",void 0),t([ge({type:String})],Yl.prototype,"refreshKey",void 0),t([ge({type:Object})],Yl.prototype,"exclusions",void 0);class Kl extends lt{static get styles(){return r`
2829
2899
  :host {
2830
2900
  align-items: center;
@@ -3860,7 +3930,7 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
3860
3930
  </div>
3861
3931
  </div>
3862
3932
  </div>
3863
- `}}t([ge({type:Boolean})],ah.prototype,"open",void 0),t([ge({type:Boolean})],ah.prototype,"top",void 0),t([ge({type:Boolean})],ah.prototype,"bottom",void 0),t([ge({type:Boolean})],ah.prototype,"left",void 0),t([ge({type:Boolean})],ah.prototype,"right",void 0),t([ge({type:Number})],ah.prototype,"arrowSize",void 0),t([ge({type:Number})],ah.prototype,"arrowOffset",void 0),t([ge({type:Number})],ah.prototype,"offsetX",void 0),t([ge({type:Number})],ah.prototype,"offsetY",void 0),t([ge({type:Boolean})],ah.prototype,"mask",void 0);class lh extends ue{constructor(){super(...arguments),this.embedded=!1,this.collapses=!1,this.bottom=!1,this.focusedName=!1,this.index=-1,this.refresh="",this.tabs=[]}static get styles(){return r`
3933
+ `}}t([ge({type:Boolean})],ah.prototype,"open",void 0),t([ge({type:Boolean})],ah.prototype,"top",void 0),t([ge({type:Boolean})],ah.prototype,"bottom",void 0),t([ge({type:Boolean})],ah.prototype,"left",void 0),t([ge({type:Boolean})],ah.prototype,"right",void 0),t([ge({type:Number})],ah.prototype,"arrowSize",void 0),t([ge({type:Number})],ah.prototype,"arrowOffset",void 0),t([ge({type:Number})],ah.prototype,"offsetX",void 0),t([ge({type:Number})],ah.prototype,"offsetY",void 0),t([ge({type:Boolean})],ah.prototype,"mask",void 0);class lh extends ue{constructor(){super(...arguments),this.embedded=!1,this.collapses=!1,this.bottom=!1,this.unselect=!1,this.focusedName=!1,this.index=-1,this.refresh="",this.tabs=[]}static get styles(){return r`
3864
3934
  :host {
3865
3935
  display: flex;
3866
3936
  flex-direction: column;
@@ -3969,6 +4039,14 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
3969
4039
  .bottom .tab.selected {
3970
4040
  }
3971
4041
 
4042
+ .unselect .tab.selected {
4043
+ cursor: pointer;
4044
+ }
4045
+
4046
+ .unselect .tab.selected:hover {
4047
+ background: var(--unselect-tab-color, #eee);
4048
+ }
4049
+
3972
4050
  .tab:hover {
3973
4051
  --icon-color: #666;
3974
4052
  color: #666;
@@ -4056,7 +4134,7 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
4056
4134
  .pane {
4057
4135
  display: flex;
4058
4136
  }
4059
- `}handleTabClick(t){this.index=parseInt(t.currentTarget.dataset.index),t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}handleSlotChange(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}this.tabs=t}firstUpdated(t){super.firstUpdated(t),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){if(super.updated(t),(t.has("index")||t.has("tabs"))&&(this.tabs.forEach(((t,e)=>{t.selected=e==this.index})),this.fireEvent(Oe.ContextChanged)),this.index>this.tabs.length){const t=this.tabs[this.index];if(t&&t.hidden)for(let t=0;t<this.tabs.length;t++){const e=this.tabs[t];if(e&&!e.hidden)return void(this.index=t)}}}setTabDetails(t,e){if(t<this.tabs.length){const i=this.tabs[t];i.count=e.count,i.hidden=e.hidden,this.requestUpdate()}else setTimeout((()=>{this.setTabDetails(t,e)}),100)}getCurrentTab(){return this.tabs[this.index]}getTab(t){return this.tabs[t]}handleTabContentChanged(){this.requestUpdate()}render(){return j`
4137
+ `}handleTabClick(t){const e=parseInt(t.currentTarget.dataset.index);this.unselect&&this.index===e?this.index=-1:this.index=e,t.preventDefault(),t.stopPropagation(),this.requestUpdate("index")}handleSlotChange(){const t=[];for(const e of this.children)if("TEMBA-TAB"===e.tagName){const i=e;t.push(i)}this.tabs=t}firstUpdated(t){super.firstUpdated(t),this.shadowRoot.addEventListener("slotchange",this.handleSlotChange.bind(this))}updated(t){if(super.updated(t),(t.has("index")||t.has("tabs"))&&(this.tabs.forEach(((t,e)=>{t.selected=e==this.index})),this.fireEvent(Oe.ContextChanged)),this.index>this.tabs.length){const t=this.tabs[this.index];if(t&&t.hidden)for(let t=0;t<this.tabs.length;t++){const e=this.tabs[t];if(e&&!e.hidden)return void(this.index=t)}}}setTabDetails(t,e){if(t<this.tabs.length){const i=this.tabs[t];i.count=e.count,i.hidden=e.hidden,this.requestUpdate()}else setTimeout((()=>{this.setTabDetails(t,e)}),100)}getCurrentTab(){return this.tabs[this.index]}getTab(t){return this.tabs[t]}handleTabContentChanged(){this.requestUpdate()}render(){return j`
4060
4138
  ${this.bottom?j`<div
4061
4139
  class="pane ${Vt({first:0==this.index,embedded:this.embedded,bottom:this.bottom})}"
4062
4140
  >
@@ -4064,7 +4142,7 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
4064
4142
  </div>`:null}
4065
4143
 
4066
4144
  <div
4067
- class="tabs ${Vt({tabs:!0,bottom:this.bottom,collapses:this.collapses,embedded:this.embedded,focusedname:this.focusedName})}"
4145
+ class="tabs ${Vt({tabs:!0,bottom:this.bottom,collapses:this.collapses,embedded:this.embedded,focusedname:this.focusedName,unselect:this.unselect})}"
4068
4146
  >
4069
4147
  ${this.tabs.map(((t,e)=>j`
4070
4148
  <div
@@ -4096,7 +4174,7 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
4096
4174
  >
4097
4175
  <slot></slot>
4098
4176
  </div>`}
4099
- `}}t([ge({type:Boolean})],lh.prototype,"embedded",void 0),t([ge({type:Boolean})],lh.prototype,"collapses",void 0),t([ge({type:Boolean})],lh.prototype,"bottom",void 0),t([ge({type:Boolean})],lh.prototype,"focusedName",void 0),t([ge({type:Number})],lh.prototype,"index",void 0),t([ge({type:String})],lh.prototype,"refresh",void 0),t([ge({type:Array,attribute:!1})],lh.prototype,"tabs",void 0);class hh extends ue{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.hidden=!1,this.count=0,this.checked=!1}static get styles(){return r`
4177
+ `}}t([ge({type:Boolean})],lh.prototype,"embedded",void 0),t([ge({type:Boolean})],lh.prototype,"collapses",void 0),t([ge({type:Boolean})],lh.prototype,"bottom",void 0),t([ge({type:Boolean})],lh.prototype,"unselect",void 0),t([ge({type:Boolean})],lh.prototype,"focusedName",void 0),t([ge({type:Number})],lh.prototype,"index",void 0),t([ge({type:String})],lh.prototype,"refresh",void 0),t([ge({type:Array,attribute:!1})],lh.prototype,"tabs",void 0);class hh extends ue{constructor(){super(...arguments),this.selected=!1,this.notify=!1,this.hidden=!1,this.count=0,this.checked=!1}static get styles(){return r`
4100
4178
  :host {
4101
4179
  display: none;
4102
4180
  flex-direction: column;
@@ -5935,6 +6013,10 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
5935
6013
  title="${this.datetime.toLocaleString(Ph.datetime)}"
5936
6014
  >${t}</span
5937
6015
  >`}}}t([ge({type:String})],Ih.prototype,"value",void 0),t([ge({type:String})],Ih.prototype,"display",void 0),t([ge({type:Object,attribute:!1})],Ih.prototype,"datetime",void 0);let Dh=class extends ue{constructor(){super(...arguments),this.body=j`<temba-loading></temba-loading>`}static get styles(){return r``}updated(t){super.updated(t),t.has("endpoint")&&jt(this.endpoint).then((t=>{this.body=pr(t.body)}))}render(){return j`${this.body}`}};t([ge({type:String})],Dh.prototype,"endpoint",void 0),t([ge({attribute:!1})],Dh.prototype,"body",void 0),Dh=t([(t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)})("temba-remote")],Dh);var Nh,Bh=Dh;class Rh extends fe{static get styles(){return r`
6016
+ :host {
6017
+ --textarea-min-height: var(--textarea-min-height, 4em);
6018
+ }
6019
+
5938
6020
  .container {
5939
6021
  display: flex;
5940
6022
  flex-direction: column;
@@ -5955,7 +6037,7 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
5955
6037
  --compose-curvature,
5956
6038
  var(--curvature) var(--curvature) 0px 0px
5957
6039
  );
5958
- --textarea-min-height: var(--textarea-min-height, 4em);
6040
+
5959
6041
  --widget-box-shadow: none;
5960
6042
  padding: var(--compose-padding, 0px);
5961
6043
  }
@@ -6071,6 +6153,7 @@ let ir=Is,or=!1;const nr=["es","fr","pt"],{setLocale:sr}=(t=>(function(t){if(or)
6071
6153
  embedded
6072
6154
  focusedname
6073
6155
  bottom
6156
+ unselect
6074
6157
  refresh="${this.currentAttachments.length}|${this.index}|${this.currentQuickReplies.length}|${t}|${this.currentOptin}"
6075
6158
  >
6076
6159
  ${this.attachments?j`<temba-tab