@nyaruka/temba-components 0.158.1 → 0.158.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
|
@@ -4,8 +4,24 @@ 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.158.3](https://github.com/nyaruka/temba-components/compare/v0.158.2...v0.158.3)
|
|
8
|
+
|
|
9
|
+
- Add CI-only devcontainer under .github/devcontainer [`4f92665`](https://github.com/nyaruka/temba-components/commit/4f92665ed4e01a51fbcf9dd97e559892ad6a5b7b)
|
|
10
|
+
|
|
11
|
+
#### [v0.158.2](https://github.com/nyaruka/temba-components/compare/v0.158.1...v0.158.2)
|
|
12
|
+
|
|
13
|
+
> 27 May 2026
|
|
14
|
+
|
|
15
|
+
- Bump serialize-javascript from 6.0.2 to 7.0.5 [`#1017`](https://github.com/nyaruka/temba-components/pull/1017)
|
|
16
|
+
- Split resthook nodes on @webhook.status, matching split_by_webhook [`#1018`](https://github.com/nyaruka/temba-components/pull/1018)
|
|
17
|
+
- Add regression test for legacy @webhook.json.status normalisation [`6437b32`](https://github.com/nyaruka/temba-components/commit/6437b32d9fc971d3a3b24ac104f491e21c62a2ac)
|
|
18
|
+
- Symlink .devcontainer to shared utils/projects/temba-components/.devcontainer [`c1d1678`](https://github.com/nyaruka/temba-components/commit/c1d167853579c2f961602565d087cf7c79507ec2)
|
|
19
|
+
- Add .devocontainer to .gitignore [`e1e9a40`](https://github.com/nyaruka/temba-components/commit/e1e9a403ab4f5a917e340fae328923a6b5e7a426)
|
|
20
|
+
|
|
7
21
|
#### [v0.158.1](https://github.com/nyaruka/temba-components/compare/v0.158.0...v0.158.1)
|
|
8
22
|
|
|
23
|
+
> 14 May 2026
|
|
24
|
+
|
|
9
25
|
- Add ContentList component for JSON-driven CRUDL list pages [`#1012`](https://github.com/nyaruka/temba-components/pull/1012)
|
|
10
26
|
- Only run Claude PR review once on PR creation, skip drafts [`#1015`](https://github.com/nyaruka/temba-components/pull/1015)
|
|
11
27
|
|
package/dist/temba-components.js
CHANGED
|
@@ -9948,7 +9948,7 @@ background: #ccc;
|
|
|
9948
9948
|
${this.renderUploader()}
|
|
9949
9949
|
</div>
|
|
9950
9950
|
</div>
|
|
9951
|
-
</div>`}}e([gt({type:String,attribute:!1})],Uu.prototype,"endpoint",void 0),e([gt({type:Boolean})],Uu.prototype,"pendingDrop",void 0),e([gt({type:Boolean})],Uu.prototype,"ignoreDrops",void 0),e([gt({type:String})],Uu.prototype,"icon",void 0),e([gt({type:String})],Uu.prototype,"accept",void 0),e([gt({type:Number})],Uu.prototype,"max",void 0),e([gt({type:Array})],Uu.prototype,"attachments",void 0),e([gt({type:Boolean,attribute:!1})],Uu.prototype,"uploading",void 0);let ju="dev";try{ju="0.158.
|
|
9951
|
+
</div>`}}e([gt({type:String,attribute:!1})],Uu.prototype,"endpoint",void 0),e([gt({type:Boolean})],Uu.prototype,"pendingDrop",void 0),e([gt({type:Boolean})],Uu.prototype,"ignoreDrops",void 0),e([gt({type:String})],Uu.prototype,"icon",void 0),e([gt({type:String})],Uu.prototype,"accept",void 0),e([gt({type:Number})],Uu.prototype,"max",void 0),e([gt({type:Array})],Uu.prototype,"attachments",void 0),e([gt({type:Boolean,attribute:!1})],Uu.prototype,"uploading",void 0);let ju="dev";try{ju="0.158.3"}catch(t){}const Hu=ju,Wu=[{type:"has_any_word",name:"has any of the words",operands:1},{type:"has_all_words",name:"has all of the words",operands:1},{type:"has_phrase",name:"has the phrase",operands:1},{type:"has_only_phrase",name:"has only the phrase",operands:1},{type:"has_beginning",name:"starts with",operands:1},{type:"has_text",name:"has some text",operands:0,categoryName:"Has Text"},{type:"has_number",name:"has a number",operands:0,categoryName:"Has Number"},{type:"has_number_between",name:"has a number between",operands:2},{type:"has_number_lt",name:"has a number below",operands:1},{type:"has_number_lte",name:"has a number at or below",operands:1},{type:"has_number_eq",name:"has a number equal to",operands:1},{type:"has_number_gte",name:"has a number at or above",operands:1},{type:"has_number_gt",name:"has a number above",operands:1},{type:"has_date",name:"has a date",operands:0,categoryName:"Has Date"},{type:"has_date_lt",name:"has a date before",operands:1},{type:"has_date_eq",name:"has a date equal to",operands:1},{type:"has_date_gt",name:"has a date after",operands:1},{type:"has_time",name:"has a time",operands:0,categoryName:"Has Time"},{type:"has_phone",name:"has a phone number",operands:0,categoryName:"Has Phone"},{type:"has_email",name:"has an email",operands:0,categoryName:"Has Email"},{type:"has_state",name:"has state",operands:0,categoryName:"Has State",filter:"locations"},{type:"has_district",name:"has district",operands:1,categoryName:"Has District",filter:"locations"},{type:"has_ward",name:"has ward",operands:2,categoryName:"Has Ward",filter:"locations"},{type:"has_group",name:"is in the group",operands:1,visibility:"hidden"},{type:"has_category",name:"has the category",operands:0,visibility:"hidden"},{type:"has_error",name:"has an error",operands:0,categoryName:"Has Error",visibility:"hidden"},{type:"has_value",name:"is not empty",operands:0,categoryName:"Not Empty",visibility:"hidden"},{type:"has_pattern",name:"matches regex",operands:1}],Vu=t=>Wu.filter(e=>"hidden"!==e.visibility&&(!e.filter||!!t&&t.includes(e.filter))),Zu=new Set(["has_beginning","has_number","has_number_between","has_number_lt","has_number_lte","has_number_eq","has_number_gte","has_number_gt","has_pattern"]),Yu=t=>Wu.find(e=>e.type===t),Ku=t=>t.map(t=>({value:t.type,name:t.name})),Gu={type:"text",required:!1,maxLength:64,placeholder:"(optional)",helpText:"The name to use to reference this result in the flow"},Xu={type:"checkbox",label:"Require rules to be localized",helpText:"Each language must specify its own rules for this node"},Qu={type:"checkbox",label:"Require categories to be localized",helpText:t=>{var e;const i=null===(e=t.result_name)||void 0===e?void 0:e.trim();if(i){return`Only enable if you plan to use @results.${i.toLowerCase().replace(/\s+/g,"_")}.category_localized`}return"Only enable if you plan to use category_localized in your expressions for this result"},conditions:{visible:t=>!!t.result_name}},Ju={label:"Save Result",localizable:!1,items:["result_name"],collapsed:t=>!(t._isNew&&t.result_name),getValueCount:t=>!!t.result_name},tp={type:"accordion",multi:!0,sections:[Ju,{label:"Localization",localizable:!1,items:["localizeRules","localizeCategories"],collapsed:!0,getValueCount:t=>!(!t.localizeRules&&!t.localizeCategories)}]},ep={type:"accordion",multi:!0,sections:[Ju]},ip={type:"accordion",multi:!0,sections:[Ju,{label:"Localization",localizable:!1,items:["localizeCategories"],collapsed:!0,getValueCount:t=>!!t.localizeCategories}]};function op(t,e){var i,o;const n=(null===(i=t.router)||void 0===i?void 0:i.categories)||[],s={};n.forEach(t=>{const i=t.uuid,o=e[i];s[i]={originalName:t.name,localizedName:o&&o.name?Array.isArray(o.name)?o.name[0]||"":o.name:""}});const r=(null===(o=t.router)||void 0===o?void 0:o.cases)||[],a={};return r.forEach(t=>{var i,o;if(!(null===(i=t.arguments)||void 0===i?void 0:i.length)||!t.arguments.some(t=>t))return;const n=e[t.uuid],s=(null===(o=Yu(t.type))||void 0===o?void 0:o.name)||t.type;a[t.uuid]={operatorName:s,originalArguments:[...t.arguments],localizedArguments:(null==n?void 0:n.arguments)?[...n.arguments]:t.arguments.map(()=>"")}}),{categories:s,rules:a}}function np(t,e){const i={};return t.categories&&Object.keys(t.categories).forEach(e=>{var o,n;const s=t.categories[e],r=(null===(o=s.localizedName)||void 0===o?void 0:o.trim())||"",a=(null===(n=s.originalName)||void 0===n?void 0:n.trim())||"";r&&r!==a&&(i[e]={name:[r]})}),t.rules&&Object.keys(t.rules).forEach(e=>{const o=t.rules[e],n=o.localizedArguments||[],s=o.originalArguments||[],r=n.some((t,e)=>(null==t?void 0:t.trim())&&t.trim()!==(s[e]||""));r&&(i[e]={arguments:n.map(t=>(null==t?void 0:t.trim())||"")})}),i}function sp(t,e,i,o=[]){const n=[],s=[],r=[];return t.forEach(t=>{const a=re(e,t.name),l=a?i.find(t=>t.uuid===a.exit_uuid):null,d=(null==l?void 0:l.uuid)||Gt(),c=(null==a?void 0:a.uuid)||Gt();if(n.push({uuid:c,name:t.name,exit_uuid:d}),s.push({uuid:d,destination_uuid:(null==l?void 0:l.destination_uuid)||null}),t.case){const e=t.case.arguments[0],i=o.find(t=>{var i;return(null===(i=t.arguments)||void 0===i?void 0:i[0])===e});r.push({uuid:(null==i?void 0:i.uuid)||Gt(),type:t.case.type,arguments:t.case.arguments,category_uuid:c})}}),{categories:n,exits:s,cases:r}}function rp(t,e,i,o,n){const s=n.some(t=>se(t,"Other"))?null:re(i,"Other"),r=s?o.find(t=>t.uuid===s.exit_uuid):null,a=(null==r?void 0:r.uuid)||Gt(),l=(null==s?void 0:s.uuid)||Gt();return t.push({uuid:l,name:"Other",exit_uuid:a}),e.push({uuid:a,destination_uuid:(null==r?void 0:r.destination_uuid)||null}),l}function ap(t){return e=>{const i={};return t(e,i),{valid:0===Object.keys(i).length,errors:i}}}function lp(t){return t.toLocalizationFormData?t.toLocalizationFormData:"categories"===t.localizable?op:Array.isArray(t.localizable)?(e=t.localizable,(t,i)=>{const o={uuid:t.uuid};return e.forEach(t=>{const e=i[t];o[t]=Array.isArray(e)&&e[0]||""}),o}):void 0;var e}function dp(t){return t.fromLocalizationFormData?t.fromLocalizationFormData:"categories"===t.localizable?np:Array.isArray(t.localizable)?(e=t.localizable,(t,i)=>{const o={};return e.forEach(e=>{const n=t[e];n&&""!==n.trim()&&n!==i[e]&&(o[e]=[n])}),o}):void 0;var e}const cp="undefined"!=typeof navigator&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);function hp(t){return 0!==t.button||!(!cp||!t.ctrlKey)}function up(t){if(t.dependency){const e=t.dependency.name||t.dependency.key;return`Cannot find a ${t.dependency.type} for ${e}`}return t.description}function pp(t){const e=20*Math.round(t/20);return Math.max(e,0)}const mp="font-family:SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;font-size:0.95em",gp={[nc.ExpressionPrefix]:`color:${Cc.expression};font-weight:600;${mp}`,[nc.Identifier]:`color:${Cc.expression};${mp}`,[nc.FunctionName]:`color:${Cc.fn};font-weight:900;${mp}`,[nc.StringLiteral]:`color:${Cc.string};${mp}`,[nc.NumberLiteral]:`color:${Cc.number};${mp}`,[nc.Keyword]:`color:${Cc.keyword};${mp}`,[nc.Operator]:`color:${Cc.operator};${mp}`,[nc.ContextRef]:`color:${Cc.expression};${mp}`,[nc.Separator]:`color:${Cc.operator};${mp}`,[nc.Arrow]:`color:${Cc.operator};${mp}`,[nc.Bracket]:`color:${Cc.operator};${mp}`,[nc.Paren]:`color:${Cc.paren};${mp}`,[nc.Whitespace]:mp},fp=[[/claude|anthropic/i,"anthropic"],[/gpt|openai|o1|o3|o4/i,"openai"],[/gemini|google/i,"gemini"],[/azure|microsoft/i,"azure"],[/deepseek/i,"deepseek"]],vp=(t,e=!1)=>{const i=cc(t||"",e?Gd:Kd),o=[];for(const t of i){const e=!!gp[t.type],i=o[o.length-1];i&&i.isExpr===e?i.tokens.push(t):o.push({isExpr:e,tokens:[t]})}const n=t=>{const e=gp[t.type];if(!e){const e=t.text.split("\n");return V`${e.map((t,e)=>V`${e>0?V`<br />`:null}${t}`)}`}const i=t.text.split("\n");return V`${i.map((t,i)=>V`${i>0?V`<br />`:null}${t?V`<span style="${e}">${t}</span>`:null}`)}`};return V`${o.map(t=>{const e=V`${t.tokens.map(n)}`;return t.isExpr?V`<span style="hyphens:none">${e}</span>`:e})}`},bp=(t,e,i=3)=>V`<div
|
|
9952
9952
|
style="display: -webkit-box; -webkit-line-clamp: ${i}; -webkit-box-orient: vertical; overflow: hidden; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto;"
|
|
9953
9953
|
title="${e}"
|
|
9954
9954
|
>
|
|
@@ -10083,7 +10083,7 @@ background: #ccc;
|
|
|
10083
10083
|
</div>
|
|
10084
10084
|
`},toFormData:t=>{var e;const i=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"open_ticket"===t.type);return{uuid:t.uuid,topic:(null==i?void 0:i.topic)?[{uuid:i.topic.uuid,name:i.topic.name}]:[],assignee:(null==i?void 0:i.assignee)?[{uuid:i.assignee.uuid,name:i.assignee.name}]:[],note:(null==i?void 0:i.note)||""}},fromFormData:(t,e)=>{var i,o,n;const s=null===(i=e.actions)||void 0===i?void 0:i.find(t=>"open_ticket"===t.type),r={type:"open_ticket",uuid:(null==s?void 0:s.uuid)||Gt(),topic:t.topic&&t.topic.length>0?{uuid:t.topic[0].uuid,name:t.topic[0].name}:void 0,assignee:t.assignee&&t.assignee.length>0?{uuid:t.assignee[0].uuid,name:t.assignee[0].name||[t.assignee[0].first_name,t.assignee[0].last_name].join(" ")}:void 0,note:t.note||""},a=(null===(o=e.router)||void 0===o?void 0:o.categories)||[],l=e.exits||[],d=(null===(n=e.router)||void 0===n?void 0:n.cases)||[],{router:c,exits:h}=Fe("@locals._new_ticket",{type:"has_text",arguments:[]},a,l,d);return{uuid:e.uuid,actions:[r],router:c,exits:h}},localizable:"categories",nonTranslatableCategories:"all"},Bm=[{key:"Accept",value:"application/json"}],Fm=[{key:"Accept",value:"application/json"},{key:"Content-Type",value:"application/json"}];const qm='@(json(object(\n "contact", object(\n "uuid", contact.uuid, \n "name", contact.name, \n "urn", contact.urn\n ),\n "flow", object(\n "uuid", run.flow.uuid, \n "name", run.flow.name\n ),\n "results", foreach_value(results, extract_object, "value", "category")\n)))',Um={type:"split_by_webhook",name:"Call Webhook",group:Np.services,flowTypes:[Op,Lp,Pp],showAsAction:!0,form:{method:{type:"select",required:!0,options:["GET","POST","PUT","DELETE","HEAD","PATCH"],maxWidth:"120px",searchable:!1},url:{type:"text",required:!0,evaluated:!0,placeholder:"https://example.com/webhook"},headers:{type:"key-value",sortable:!0,keyPlaceholder:"Header name",valuePlaceholder:"Header value",minRows:0,dependsOn:["method"],computeValue:(t,e,i)=>{const o=Array.isArray(t.method)&&t.method.length>0?t.method[0].value||t.method[0].name:t.method;return function(t){if(!t||0===t.length)return!0;const e=t.filter(t=>""!==(t.key||t.name||"")||""!==(t.value||""));if(0===e.length)return!0;for(const t of[Bm,Fm])if(e.length===t.length&&e.every((e,i)=>(e.key||e.name)===t[i].key&&e.value===t[i].value))return!0;return!1}(e)?function(t){return"POST"===t||"PUT"===t||"PATCH"===t?Fm.map(t=>({...t})):Bm.map(t=>({...t}))}(o):e}},result_name:Gu,body:{type:"textarea",evaluated:!0,placeholder:"Request body content (JSON, XML, etc.)",minHeight:200,dependsOn:["method"],computeValue:(t,e,i)=>{if("POST"===(Array.isArray(t.method)&&t.method.length>0?t.method[0].value||t.method[0].name:t.method)){if(!e||""===e.trim())return qm}else{const t=(null==i?void 0:i.body)||"";if(!t||""===t.trim()||!e||""===e.trim()||e.trim()===qm.trim())return""}return e}}},layout:[{type:"row",items:["method","url"]},{type:"accordion",sections:[{label:"Headers",collapsed:!0,getValueCount:t=>{var e;return(null===(e=t.headers)||void 0===e?void 0:e.length)||0},items:["headers"]},{label:"Body",collapsed:!0,getValueCount:t=>!(!t.body||""===t.body.trim()||t.body===qm),items:["body"]}]},"result_name"],render:t=>{var e;const i=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_webhook"===t.type),o=(null==i?void 0:i.url)||"Configure webhook";return V` <div class="body">
|
|
10085
10085
|
${bp(vp(o,!0),o)}
|
|
10086
|
-
</div>`},toFormData:t=>{var e,i;const o=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_webhook"===t.type);return{uuid:t.uuid,method:(null==o?void 0:o.method)||"GET",url:(null==o?void 0:o.url)||"",headers:(null==o?void 0:o.headers)||(n=(null==o?void 0:o.method)||"GET","POST"===n||"PUT"===n||"PATCH"===n?{Accept:"application/json","Content-Type":"application/json"}:{Accept:"application/json"}),body:(null==o?void 0:o.body)||"",result_name:(null===(i=t.router)||void 0===i?void 0:i.result_name)||""};var n},fromFormData:(t,e)=>{var i,o,n;const s=Array.isArray(t.method)&&t.method.length>0?t.method[0]:{value:"GET"},r=null===(i=e.actions)||void 0===i?void 0:i.find(t=>"call_webhook"===t.type),a={type:"call_webhook",uuid:(null==r?void 0:r.uuid)||Gt(),method:s.value,url:t.url||"",headers:t.headers||[],body:t.body||""},l=(null===(o=e.router)||void 0===o?void 0:o.categories)||[],d=e.exits||[],c=(null===(n=e.router)||void 0===n?void 0:n.cases)||[],{router:h,exits:u}=Fe("@webhook.status",{type:"has_number_between",arguments:["200","299"]},l,d,c),p={...h};return t.result_name&&""!==t.result_name.trim()&&(p.result_name=t.result_name.trim()),{uuid:e.uuid,actions:[a],router:p,exits:u}},localizable:"categories",nonTranslatableCategories:"all"},jm={type:"split_by_resthook",name:"Call Resthook",group:Np.services,flowTypes:[Op,Lp,Pp],showAsAction:!0,form:{resthook:{type:"select",label:"Resthook",required:!0,searchable:!0,clearable:!1,placeholder:"Select a resthook...",endpoint:"/api/v2/resthooks.json",valueKey:"resthook",nameKey:"resthook",helpText:"Select the resthook to call"},result_name:Gu},layout:["resthook","result_name"],validate:ap((t,e)=>{t.resthook&&0!==t.resthook.length||(e.resthook="A resthook is required")}),render:t=>{var e;const i=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_resthook"===t.type),o=(null==i?void 0:i.resthook)||"Configure resthook";return V` <div class="body">${bp(o,o)}</div> `},toFormData:t=>{var e,i;const o=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_resthook"===t.type);return{uuid:t.uuid,resthook:(null==o?void 0:o.resthook)?[{resthook:o.resthook}]:[],result_name:(null===(i=t.router)||void 0===i?void 0:i.result_name)||""}},fromFormData:(t,e)=>{var i,o,n;const s=Array.isArray(t.resthook)&&t.resthook.length>0?t.resthook[0]:null;if(!s)return e;const r=null===(i=e.actions)||void 0===i?void 0:i.find(t=>"call_resthook"===t.type),a={type:"call_resthook",uuid:(null==r?void 0:r.uuid)||Gt(),resthook:s.resthook},l=(null===(o=e.router)||void 0===o?void 0:o.categories)||[],d=e.exits||[],c=(null===(n=e.router)||void 0===n?void 0:n.cases)||[],{router:h,exits:u}=Fe("@webhook.
|
|
10086
|
+
</div>`},toFormData:t=>{var e,i;const o=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_webhook"===t.type);return{uuid:t.uuid,method:(null==o?void 0:o.method)||"GET",url:(null==o?void 0:o.url)||"",headers:(null==o?void 0:o.headers)||(n=(null==o?void 0:o.method)||"GET","POST"===n||"PUT"===n||"PATCH"===n?{Accept:"application/json","Content-Type":"application/json"}:{Accept:"application/json"}),body:(null==o?void 0:o.body)||"",result_name:(null===(i=t.router)||void 0===i?void 0:i.result_name)||""};var n},fromFormData:(t,e)=>{var i,o,n;const s=Array.isArray(t.method)&&t.method.length>0?t.method[0]:{value:"GET"},r=null===(i=e.actions)||void 0===i?void 0:i.find(t=>"call_webhook"===t.type),a={type:"call_webhook",uuid:(null==r?void 0:r.uuid)||Gt(),method:s.value,url:t.url||"",headers:t.headers||[],body:t.body||""},l=(null===(o=e.router)||void 0===o?void 0:o.categories)||[],d=e.exits||[],c=(null===(n=e.router)||void 0===n?void 0:n.cases)||[],{router:h,exits:u}=Fe("@webhook.status",{type:"has_number_between",arguments:["200","299"]},l,d,c),p={...h};return t.result_name&&""!==t.result_name.trim()&&(p.result_name=t.result_name.trim()),{uuid:e.uuid,actions:[a],router:p,exits:u}},localizable:"categories",nonTranslatableCategories:"all"},jm={type:"split_by_resthook",name:"Call Resthook",group:Np.services,flowTypes:[Op,Lp,Pp],showAsAction:!0,form:{resthook:{type:"select",label:"Resthook",required:!0,searchable:!0,clearable:!1,placeholder:"Select a resthook...",endpoint:"/api/v2/resthooks.json",valueKey:"resthook",nameKey:"resthook",helpText:"Select the resthook to call"},result_name:Gu},layout:["resthook","result_name"],validate:ap((t,e)=>{t.resthook&&0!==t.resthook.length||(e.resthook="A resthook is required")}),render:t=>{var e;const i=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_resthook"===t.type),o=(null==i?void 0:i.resthook)||"Configure resthook";return V` <div class="body">${bp(o,o)}</div> `},toFormData:t=>{var e,i;const o=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_resthook"===t.type);return{uuid:t.uuid,resthook:(null==o?void 0:o.resthook)?[{resthook:o.resthook}]:[],result_name:(null===(i=t.router)||void 0===i?void 0:i.result_name)||""}},fromFormData:(t,e)=>{var i,o,n;const s=Array.isArray(t.resthook)&&t.resthook.length>0?t.resthook[0]:null;if(!s)return e;const r=null===(i=e.actions)||void 0===i?void 0:i.find(t=>"call_resthook"===t.type),a={type:"call_resthook",uuid:(null==r?void 0:r.uuid)||Gt(),resthook:s.resthook},l=(null===(o=e.router)||void 0===o?void 0:o.categories)||[],d=e.exits||[],c=(null===(n=e.router)||void 0===n?void 0:n.cases)||[],{router:h,exits:u}=Fe("@webhook.status",{type:"has_number_between",arguments:["200","299"]},l,d,c),p={...h};return t.result_name&&""!==t.result_name.trim()&&(p.result_name=t.result_name.trim()),{uuid:e.uuid,actions:[a],router:p,exits:u}},localizable:"categories",nonTranslatableCategories:"all"},Hm={type:"split_by_llm",name:"Call AI",group:Np.services,flowTypes:[Op,Lp,Pp],showAsAction:!0,render:t=>{var e,i;const o=null===(e=t.actions)||void 0===e?void 0:e.find(t=>"call_llm"===t.type),n=(null==o?void 0:o.instructions)||"Configure AI instructions",s=null===(i=null==o?void 0:o.llm)||void 0===i?void 0:i.name;return V`
|
|
10087
10087
|
${s?V`<div class="body" style="padding-bottom:0;">
|
|
10088
10088
|
${xp(s,(t=>{if(!t)return null;for(const[e,i]of fp)if(e.test(t))return i;return null})(s))}
|
|
10089
10089
|
</div>`:null}
|