UNPKG

@tripetto/block-variable

Version:

Variable block for Tripetto.

2 lines 53.5 kB
/*! Tripetto Variable Block 3.0.3 - Copyright (C) 2023 Tripetto B.V. - All Rights Reserved */ !function(){"use strict";var e={452:function(e,t,i){var a,l=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__decorate||function(e,t,i,a){var l,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};Object.defineProperty(t,"__esModule",{value:!0}),t.VariableBooleanCondition=void 0;var n=i(954),r=i(982),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allowMarkdown=!0,t.mode="true",t}return l(t,e),Object.defineProperty(t.prototype,"label",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){var e,t=this.slot;if(t instanceof n.Slots.Boolean)switch(this.mode){case"true":return"@".concat(t.id," = ").concat((0,n.makeMarkdownSafe)(t.labelForTrue||"")||(0,n.pgettext)("block:variable","True"));case"false":return"@".concat(t.id," = ").concat((0,n.makeMarkdownSafe)(t.labelForFalse||"")||(0,n.pgettext)("block:variable","False"));case"equal":case"not-equal":return"@".concat(t.id," ").concat("not-equal"===this.mode?"≠":"="," ").concat((0,n.isVariable)(this.value)&&(null===(e=(0,n.lookupVariable)(this,this.value))||void 0===e?void 0:e.label)?"@".concat(this.value):"\\_\\_");case"defined":return"@".concat(t.id," ").concat((0,n.pgettext)("block:variable","not empty"));case"undefined":return"@".concat(t.id," ").concat((0,n.pgettext)("block:variable","empty"))}return this.type.label},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){var e;return null===(e=this.node)||void 0===e?void 0:e.label},enumerable:!1,configurable:!0}),t.prototype.defineEditor=function(){var e,t=this;this.editor.form({title:(0,n.pgettext)("block:variable","Compare mode"),controls:[new n.Forms.Radiobutton([{label:this.slot instanceof n.Slots.Boolean&&this.slot.labelForTrue||(0,n.pgettext)("block:variable","Is true"),value:"true"},{label:this.slot instanceof n.Slots.Boolean&&this.slot.labelForFalse||(0,n.pgettext)("block:variable","Is false"),value:"false"},{label:(0,n.pgettext)("block:variable","Equals another variable"),value:"equal"},{label:(0,n.pgettext)("block:variable","Not equals another variable"),value:"not-equal"},{label:(0,n.pgettext)("block:variable","Is not empty"),value:"defined"},{label:(0,n.pgettext)("block:variable","Is empty"),value:"undefined"}],n.Forms.Radiobutton.bind(this,"mode","true")).on((function(e){switch("equal"!==e.value&&"not-equal"!==e.value&&(t.value=void 0),o.visible("equal"===e.value||"not-equal"===e.value),e.value){case"equal":o.title=(0,n.pgettext)("block:variable","If value matches");break;case"not-equal":o.title=(0,n.pgettext)("block:variable","If value does not match")}}))]});var i=this.value&&(0,n.isVariable)(this.value)||!1,a=(0,n.populateVariables)(this,(function(e,t){return!t&&e instanceof n.Slots.Boolean}),i?this.value:void 0,!1,null===(e=this.slot)||void 0===e?void 0:e.id),l=new n.Forms.Dropdown(a,i?this.value:"").width("full").on((function(e){e.isFormVisible&&e.isObservable&&(t.value=e.value||void 0)})),o=this.editor.form({title:(0,n.pgettext)("block:variable","If value matches"),controls:[l]}).visible("equal"===this.mode||"not-equal"===this.mode)},o([n.definition,(0,n.affects)("#name")],t.prototype,"mode",void 0),o([n.definition,(0,n.affects)("#name")],t.prototype,"value",void 0),o([n.editor],t.prototype,"defineEditor",null),t=o([(0,n.tripetto)({type:"condition",legacyBlock:!0,context:"@tripetto/block-variable",identifier:"".concat("@tripetto/block-variable",":boolean"),version:"3.0.3",icon:r.default,get label(){return(0,n.pgettext)("block:variable","Verify value")}})],t)}(n.ConditionBlock);t.VariableBooleanCondition=s},737:function(e,t,i){var a,l=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__decorate||function(e,t,i,a){var l,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};Object.defineProperty(t,"__esModule",{value:!0}),t.VariableDateCondition=void 0;var n=i(954),r=i(257),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allowMarkdown=!0,t.mode="equal",t}return l(t,e),Object.defineProperty(t.prototype,"label",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){var e=this.slot;if(e instanceof n.Slots.Date){var t=this.parse(e,this.value);switch(this.mode){case"between":return"".concat(t," ≤ @").concat(e.id," ≤ ").concat(this.parse(e,this.to));case"not-between":return"@".concat(e.id," < ").concat(t," ").concat((0,n.pgettext)("block:variable","or")," @").concat(e.id," > ").concat(this.parse(e,this.to));case"defined":return"@".concat(e.id," ").concat((0,n.pgettext)("block:variable","not empty"));case"undefined":return"@".concat(e.id," ").concat((0,n.pgettext)("block:variable","empty"));case"before":case"after":case"equal":case"not-equal":return"@".concat(e.id," ").concat("after"===this.mode?">":"before"===this.mode?"<":"not-equal"===this.mode?"≠":"="," ").concat(t)}}return this.type.label},enumerable:!1,configurable:!0}),t.prototype.parse=function(e,t){var i;return(0,n.isNumberFinite)(t)?e.supportsTime?n.L10n.locale.dateTimeShort(e.toValue(t),!0):n.L10n.locale.dateShort(e.toValue(t),!0):(0,n.isString)(t)?t&&(null===(i=(0,n.lookupVariable)(this,t))||void 0===i?void 0:i.label)?"@".concat(t):"\\_\\_":"`"+(0,n.pgettext)("block:variable","Now").toUpperCase()+"`"},t.prototype.defineEditor=function(){var e=this,t=this.slot instanceof n.Slots.Date&&this.slot.supportsTime;this.editor.form({title:(0,n.pgettext)("block:variable","Compare mode"),controls:[new n.Forms.Radiobutton([{label:(0,n.pgettext)("block:variable","Date is equal to"),value:"equal"},{label:(0,n.pgettext)("block:variable","Date is not equal to"),value:"not-equal"},{label:(0,n.pgettext)("block:variable","Date is before"),value:"before"},{label:(0,n.pgettext)("block:variable","Date is after"),value:"after"},{label:(0,n.pgettext)("block:variable","Date is between"),value:"between"},{label:(0,n.pgettext)("block:variable","Date is not between"),value:"not-between"},{label:(0,n.pgettext)("block:variable","Date is not empty"),value:"defined"},{label:(0,n.pgettext)("block:variable","Date is empty"),value:"undefined"}],n.Forms.Radiobutton.bind(this,"mode","equal")).on((function(e){switch(a.visible("defined"!==e.value&&"undefined"!==e.value),l.visible("between"===e.value||"not-between"===e.value),e.value){case"equal":a.title=(0,n.pgettext)("block:variable","If date equals");break;case"not-equal":a.title=(0,n.pgettext)("block:variable","If date not equals");break;case"before":a.title=(0,n.pgettext)("block:variable","If date is before");break;case"after":a.title=(0,n.pgettext)("block:variable","If date is after");break;case"between":a.title=(0,n.pgettext)("block:variable","If date is between");break;case"not-between":a.title=(0,n.pgettext)("block:variable","If date is not between")}}))]});var i=function(i,a,l){var o,r=e[i],s=(0,n.populateVariables)(e,(function(e){return e instanceof n.Slots.Date}),(0,n.isString)(r)?r:void 0,!0,null===(o=e.slot)||void 0===o?void 0:o.id),c=new n.Forms.DateTime((0,n.isNumberFinite)(r)?r:n.DateTime.UTCToday+("to"===i?86399999:0)).label(t?(0,n.pgettext)("block:variable","Use fixed date/time"):(0,n.pgettext)("block:variable","Use fixed date")).features(1|(t?8:32)).years((new Date).getFullYear()-150,(new Date).getFullYear()+50).zone("UTC").width("full").required().on((function(t){t.isFormVisible&&t.isObservable&&(e[i]=t.value)})),u=new n.Forms.Dropdown(s,(0,n.isString)(r)?r:"").label((0,n.pgettext)("block:variable","Use value of")).width("full").on((function(t){t.isFormVisible&&t.isObservable&&(e[i]=t.value||"")}));return e.editor.form({title:a,controls:[new n.Forms.Radiobutton([{label:t?(0,n.pgettext)("block:variable","Current date/time"):(0,n.pgettext)("block:variable","Current date"),value:"current"},{label:t?(0,n.pgettext)("block:variable","Fixed date/time"):(0,n.pgettext)("block:variable","Fixed date"),value:"date"},{label:(0,n.pgettext)("block:variable","Value"),value:"variable",disabled:0===s.length}],(0,n.isString)(r)?"variable":(0,n.isNumberFinite)(r)?"date":"current").on((function(t){c.visible("date"===t.value),u.visible("variable"===t.value),"current"===t.value&&(e[i]=void 0)})),c,u]}).visible(l)},a=i("value",(0,n.pgettext)("block:variable","If date equals"),"defined"!==this.mode&&"undefined"!==this.mode),l=i("to",(0,n.pgettext)("block:variable","And"),"between"===this.mode||"not-between"===this.mode)},o([n.definition,(0,n.affects)("#name")],t.prototype,"mode",void 0),o([n.definition,(0,n.affects)("#name")],t.prototype,"value",void 0),o([n.definition,(0,n.affects)("#name")],t.prototype,"to",void 0),o([n.editor],t.prototype,"defineEditor",null),t=o([(0,n.tripetto)({type:"condition",legacyBlock:!0,context:"@tripetto/block-variable",identifier:"".concat("@tripetto/block-variable",":date"),version:"3.0.3",icon:r.default,get label(){return(0,n.pgettext)("block:variable","Verify date")}})],t)}(n.ConditionBlock);t.VariableDateCondition=s},226:function(e,t,i){var a,l=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__decorate||function(e,t,i,a){var l,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};Object.defineProperty(t,"__esModule",{value:!0}),t.VariableNumericCondition=void 0;var n=i(954),r=i(953),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allowMarkdown=!0,t.mode="equal",t}return l(t,e),Object.defineProperty(t.prototype,"label",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){var e=this.slot;if(e instanceof n.Slots.Numeric){var t=this.parse(e,this.value);switch(this.mode){case"between":return"".concat(t," ≤ @").concat(e.id," ≤ ").concat(this.parse(e,this.to));case"not-between":return"@".concat(e.id," < ").concat(t," ").concat((0,n.pgettext)("block:variable","or")," @").concat(e.id," > ").concat(this.parse(e,this.to));case"defined":return"@".concat(e.id," ").concat((0,n.pgettext)("block:variable","not empty"));case"undefined":return"@".concat(e.id," ").concat((0,n.pgettext)("block:variable","empty"));case"not-equal":return"@".concat(e.id," ≠ ").concat(t);case"above":case"below":case"equal":return"@".concat(e.id," ").concat("above"===this.mode?">":"below"===this.mode?"<":"="," ").concat(t)}}return this.type.label},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){var e;return null===(e=this.node)||void 0===e?void 0:e.label},enumerable:!1,configurable:!0}),t.prototype.parse=function(e,t){var i;return(0,n.isNumberFinite)(t)?e.toString(t,(function(e,t){return n.L10n.locale.number(e,t,!1)})):(0,n.isString)(t)&&t&&(null===(i=(0,n.lookupVariable)(this,t))||void 0===i?void 0:i.label)?"@"+t:"\\_\\_"},t.prototype.defineEditor=function(){var e=this;this.editor.form({title:(0,n.pgettext)("block:variable","Compare mode"),controls:[new n.Forms.Radiobutton([{label:(0,n.pgettext)("block:variable","Number is equal to"),value:"equal"},{label:(0,n.pgettext)("block:variable","Number is not equal to"),value:"not-equal"},{label:(0,n.pgettext)("block:variable","Number is lower than"),value:"below"},{label:(0,n.pgettext)("block:variable","Number is higher than"),value:"above"},{label:(0,n.pgettext)("block:variable","Number is between"),value:"between"},{label:(0,n.pgettext)("block:variable","Number is not between"),value:"not-between"},{label:(0,n.pgettext)("block:variable","Number is not empty"),value:"defined"},{label:(0,n.pgettext)("block:variable","Number is empty"),value:"undefined"}],n.Forms.Radiobutton.bind(this,"mode","equal")).on((function(e){switch(i.visible("defined"!==e.value&&"undefined"!==e.value),a.visible("between"===e.value||"not-between"===e.value),e.value){case"equal":i.title=(0,n.pgettext)("block:variable","If number equals");break;case"not-equal":i.title=(0,n.pgettext)("block:variable","If number not equals");break;case"below":i.title=(0,n.pgettext)("block:variable","If number is lower than");break;case"above":i.title=(0,n.pgettext)("block:variable","If number is higher than");break;case"between":i.title=(0,n.pgettext)("block:variable","If number is between");break;case"not-between":i.title=(0,n.pgettext)("block:variable","If number is not between")}}))]});var t=function(t,i,a){var l,o=e[t],r=e.slot,s=new n.Forms.Numeric((0,n.isNumberFinite)(o)?o:0).label((0,n.pgettext)("block:variable","Use fixed number")).precision((null==r?void 0:r.precision)||0).digits((null==r?void 0:r.digits)||0).decimalSign((null==r?void 0:r.decimal)||"").thousands(!!(null==r?void 0:r.separator),(null==r?void 0:r.separator)||"").prefix((null==r?void 0:r.prefix)||"").prefixPlural((null==r?void 0:r.prefixPlural)||void 0).suffix((null==r?void 0:r.suffix)||"").suffixPlural((null==r?void 0:r.suffixPlural)||void 0).min(null==r?void 0:r.minimum).max(null==r?void 0:r.maximum).autoFocus("value"===t).escape(e.editor.close).enter((function(){return("between"!==e.mode&&"not-between"!==e.mode||"to"===t)&&e.editor.close()})).on((function(i){i.isFormVisible&&i.isObservable&&(e[t]=i.value)})),c=(0,n.populateVariables)(e,(function(e){return e instanceof n.Slots.Number||e instanceof n.Slots.Numeric}),(0,n.isString)(o)?o:void 0,!1,null===(l=e.slot)||void 0===l?void 0:l.id),u=new n.Forms.Dropdown(c,(0,n.isString)(o)?o:"").label((0,n.pgettext)("block:variable","Use value of")).width("full").on((function(i){i.isFormVisible&&i.isObservable&&(e[t]=i.value||"")}));return e.editor.form({title:i,controls:[new n.Forms.Radiobutton([{label:(0,n.pgettext)("block:variable","Number"),value:"number"},{label:(0,n.pgettext)("block:variable","Value"),value:"variable",disabled:0===c.length}],(0,n.isString)(o)?"variable":"number").on((function(e){s.visible("number"===e.value),u.visible("variable"===e.value),s.isObservable&&s.focus()})),s,u]}).visible(a)},i=t("value",(0,n.pgettext)("block:variable","If number equals"),"defined"!==this.mode&&"undefined"!==this.mode),a=t("to",(0,n.pgettext)("block:variable","And"),"between"===this.mode||"not-between"===this.mode)},o([n.definition,(0,n.affects)("#name")],t.prototype,"mode",void 0),o([n.definition,(0,n.affects)("#name")],t.prototype,"value",void 0),o([n.definition,(0,n.affects)("#name")],t.prototype,"to",void 0),o([n.editor],t.prototype,"defineEditor",null),t=o([(0,n.tripetto)({type:"condition",legacyBlock:!0,context:"@tripetto/block-variable",identifier:"".concat("@tripetto/block-variable",":numeric"),version:"3.0.3",icon:r.default,get label(){return(0,n.pgettext)("block:variable","Verify number")}})],t)}(n.ConditionBlock);t.VariableNumericCondition=s},789:function(e,t,i){var a,l=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__decorate||function(e,t,i,a){var l,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};Object.defineProperty(t,"__esModule",{value:!0}),t.VariableTextCondition=void 0;var n=i(954),r=i(701),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allowMarkdown=!0,t.mode="exact",t}return l(t,e),Object.defineProperty(t.prototype,"label",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){var e,t,i=this,a=this.slot;if(a instanceof n.Slots.Text){var l=((0,n.isVariable)(this.match)?(null===(e=(0,n.lookupVariable)(this,this.match))||void 0===e?void 0:e.label)&&"@".concat(this.match):this.match&&((t=(0,n.makeMarkdownSafe)(n.Str.replace(this.match,"\n","↵")))&&("contains"===i.mode||"not-contains"===i.mode||"starts"===i.mode||"ends"===i.mode)&&"_".concat(t,"_")||t))||"\\_\\_";switch(this.mode){case"exact":case"not-exact":return"@".concat(a.id," ").concat("not-exact"===this.mode?"≠":"="," ").concat(l);case"contains":case"not-contains":case"starts":case"ends":return"@".concat(a.id," ").concat("not-contains"===this.mode?(0,n.pgettext)("block:variable","does not contain"):"starts"===this.mode?(0,n.pgettext)("block:variable","starts with"):"ends"===this.mode?(0,n.pgettext)("block:variable","ends with"):(0,n.pgettext)("block:variable","contains")," ").concat(l);case"defined":return"@".concat(a.id," ").concat((0,n.pgettext)("block:variable","not empty"));case"undefined":return"@".concat(a.id," ").concat((0,n.pgettext)("block:variable","empty"))}}return this.type.label},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){var e;return null===(e=this.node)||void 0===e?void 0:e.label},enumerable:!1,configurable:!0}),t.prototype.defineEditor=function(){var e,t=this;this.editor.form({title:(0,n.pgettext)("block:variable","Compare mode"),controls:[new n.Forms.Radiobutton([{label:(0,n.pgettext)("block:variable","Text matches"),value:"exact"},{label:(0,n.pgettext)("block:variable","Text does not match"),value:"not-exact"},{label:(0,n.pgettext)("block:variable","Text contains"),value:"contains"},{label:(0,n.pgettext)("block:variable","Text does not contain"),value:"not-contains"},{label:(0,n.pgettext)("block:variable","Text starts with"),value:"starts"},{label:(0,n.pgettext)("block:variable","Text ends with"),value:"ends"},{label:(0,n.pgettext)("block:variable","Text is not empty"),value:"defined"},{label:(0,n.pgettext)("block:variable","Text is empty"),value:"undefined"}],n.Forms.Radiobutton.bind(this,"mode","exact")).on((function(e){switch(r.visible("defined"!==e.value&&"undefined"!==e.value),e.value){case"exact":r.title=(0,n.pgettext)("block:variable","If text matches");break;case"not-exact":r.title=(0,n.pgettext)("block:variable","If text does not match");break;case"contains":r.title=(0,n.pgettext)("block:variable","If text contains");break;case"not-contains":r.title=(0,n.pgettext)("block:variable","If text does not contain");break;case"starts":r.title=(0,n.pgettext)("block:variable","If text starts with");break;case"ends":r.title=(0,n.pgettext)("block:variable","If text ends with")}l.isInteractable&&l.focus()}))]});var i=this.match&&(0,n.isVariable)(this.match)||!1,a=(0,n.populateVariables)(this,void 0,i?this.match:void 0,!1,null===(e=this.slot)||void 0===e?void 0:e.id),l=new n.Forms.Text("multiline",i?"":this.match).label((0,n.pgettext)("block:variable","Use fixed text")).action("@",(0,n.insertVariable)(this,"exclude")).transformation(this.slot instanceof n.Slots.Text&&this.slot.transformation||"none").autoFocus().enter(this.editor.close).escape(this.editor.close).on((function(e){e.isFormVisible&&e.isVisible&&(t.match=e.value)})),o=new n.Forms.Dropdown(a,i?this.match:"").label((0,n.pgettext)("block:variable","Use value of")).width("full").on((function(e){e.isFormVisible&&e.isObservable&&(t.match=e.value||void 0)})),r=this.editor.form({title:(0,n.pgettext)("block:variable","If text matches"),controls:[new n.Forms.Radiobutton([{label:(0,n.pgettext)("block:variable","Text"),value:"text"},{label:(0,n.pgettext)("block:variable","Value"),value:"variable",disabled:0===a.length}],i?"variable":"text").on((function(e){l.visible("text"===e.value),o.visible("variable"===e.value),l.isInteractable&&l.focus()})),l,o,new n.Forms.Checkbox((0,n.pgettext)("block:variable","Ignore case"),n.Forms.Checkbox.bind(this,"ignoreCase",void 0,!0))]}).visible("defined"!==this.mode&&"undefined"!==this.mode)},o([n.definition,(0,n.affects)("#name")],t.prototype,"mode",void 0),o([n.definition,(0,n.affects)("#name")],t.prototype,"match",void 0),o([n.definition],t.prototype,"ignoreCase",void 0),o([n.editor],t.prototype,"defineEditor",null),t=o([(0,n.tripetto)({type:"condition",legacyBlock:!0,context:"@tripetto/block-variable",identifier:"".concat("@tripetto/block-variable",":text"),version:"3.0.3",icon:r.default,get label(){return(0,n.pgettext)("block:variable","Text match")}})],t)}(n.ConditionBlock);t.VariableTextCondition=s},110:function(e,t,i){var a,l=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__decorate||function(e,t,i,a){var l,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(n=(o<3?l(n):o>3?l(t,i,n):l(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0;var n=i(954),r=i(789),s=i(226),c=i(737),u=i(452);i(755);var b=i(659);i(582);var d=i(617),v=i(982),p=i(257),m=i(953),f=i(701),x=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allowMarkdown=!1,t.startBlank=!1,t.operations=n.Collection.of(b.Operation,t),t}return l(t,e),Object.defineProperty(t.prototype,"block",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstANS",{get:function(){return"@"+this.slot.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variableType",{get:function(){return this.currentType||"text"},set:function(e){this.currentType=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){switch(this.currentType){case"numeric":return m.default;case"boolean":return v.default;case"date":return p.default;case"text":return f.default;default:return d.default}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){switch(this.currentType){case"numeric":return(0,n.pgettext)("block:variable","%1 (number)",this.type.label);case"boolean":return(0,n.pgettext)("block:variable","%1 (boolean)",this.type.label);case"date":return this.slot instanceof n.Slots.Date&&this.slot.supportsTime?(0,n.pgettext)("block:variable","%1 (date/time)",this.type.label):(0,n.pgettext)("block:variable","%1 (date)",this.type.label);default:return(0,n.pgettext)("block:variable","%1 (text)",this.type.label)}},enumerable:!1,configurable:!0}),t.prototype.createProxy=function(e){var t=this;return{get maxLength(){return t.slot instanceof n.Slots.Text?t.slot.maxLength:void 0},set maxLength(i){var a;t.slot instanceof n.Slots.Text&&(t.slot.maxLength=i),null===(a=e().textValue)||void 0===a||a.maxLength(i||0)},get transformation(){return t.slot instanceof n.Slots.Text?t.slot.transformation:void 0},set transformation(i){var a;t.slot instanceof n.Slots.Text&&(t.slot.transformation=i),null===(a=e().textValue)||void 0===a||a.transformation(i||"none")},get numericPrecision(){return t.slot instanceof n.Slots.Numeric?t.slot.precision:void 0},set numericPrecision(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.precision=i),null===(a=e().numericValue)||void 0===a||a.precision(i||0)},get digits(){return t.slot instanceof n.Slots.Numeric?t.slot.digits:void 0},set digits(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.digits=i),null===(a=e().numericValue)||void 0===a||a.digits(i||0)},get decimal(){return t.slot instanceof n.Slots.Numeric?t.slot.decimal:void 0},set decimal(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.decimal=i),null===(a=e().numericValue)||void 0===a||a.decimalSign(i||"")},get separator(){return t.slot instanceof n.Slots.Numeric?t.slot.separator:void 0},set separator(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.separator=i),null===(a=e().numericValue)||void 0===a||a.thousands(!!i,i||"")},get numericMinimum(){return t.slot instanceof n.Slots.Numeric?t.slot.minimum:void 0},set numericMinimum(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.minimum=i),null===(a=e().numericValue)||void 0===a||a.min(i)},get numericMaximum(){return t.slot instanceof n.Slots.Numeric?t.slot.maximum:void 0},set numericMaximum(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.maximum=i),null===(a=e().numericValue)||void 0===a||a.max(i)},get prefix(){return t.slot instanceof n.Slots.Numeric?t.slot.prefix:void 0},set prefix(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.prefix=i),null===(a=e().numericValue)||void 0===a||a.prefix(i||"")},get prefixPlural(){return t.slot instanceof n.Slots.Numeric?t.slot.prefixPlural:void 0},set prefixPlural(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.prefixPlural=i),null===(a=e().numericValue)||void 0===a||a.prefixPlural(i||void 0)},get suffix(){return t.slot instanceof n.Slots.Numeric?t.slot.suffix:void 0},set suffix(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.suffix=i),null===(a=e().numericValue)||void 0===a||a.suffix(i||"")},get suffixPlural(){return t.slot instanceof n.Slots.Numeric?t.slot.suffixPlural:void 0},set suffixPlural(i){var a;t.slot instanceof n.Slots.Numeric&&(t.slot.suffixPlural=i),null===(a=e().numericValue)||void 0===a||a.suffixPlural(i||void 0)},get time(){return t.slot instanceof n.Slots.Date&&t.slot.supportsTime||void 0},set time(i){var a;t.slot instanceof n.Slots.Date&&(t.slot.precision=!0===i?"seconds":"days",t.rerender(!0)),null===(a=e().dateValue)||void 0===a||a.features(1|(!0===i?8:32))},get dateMinimum(){return t.slot instanceof n.Slots.Date?t.slot.minimum:void 0},set dateMinimum(e){t.slot instanceof n.Slots.Date&&(t.slot.minimum=e)},get dateMaximum(){return t.slot instanceof n.Slots.Date?t.slot.maximum:void 0},set dateMaximum(e){t.slot instanceof n.Slots.Date&&(t.slot.maximum=e)},get labelForFalse(){return t.slot instanceof n.Slots.Boolean?t.slot.labelForFalse:void 0},set labelForFalse(i){var a;t.slot instanceof n.Slots.Boolean&&(t.slot.labelForFalse=i),null===(a=e().booleanValue)||void 0===a||a.buttonLabel(!1,i||(0,n.pgettext)("block:variable","False"))},get labelForTrue(){return t.slot instanceof n.Slots.Boolean?t.slot.labelForTrue:void 0},set labelForTrue(i){var a;t.slot instanceof n.Slots.Boolean&&(t.slot.labelForTrue=i),null===(a=e().booleanValue)||void 0===a||a.buttonLabel(!0,i||(0,n.pgettext)("block:variable","True"))}}},t.prototype.defineSlot=function(){var e=this.slots.select("variable","static");switch(this.currentType||(e instanceof n.Slots.Numeric?this.currentType="numeric":e instanceof n.Slots.Boolean?this.currentType="boolean":e instanceof n.Slots.Date?this.currentType="date":this.currentType="text"),this.variableType){case"text":this.slot=this.slots.static({type:n.Slots.Text,reference:"variable",label:this.node.name||(0,n.pgettext)("block:variable","Variable"),exchange:["alias","exportable","transformation","maxLength"],alias:null==e?void 0:e.alias,exportable:null==e?void 0:e.exportable});break;case"numeric":this.slot=this.slots.static({type:n.Slots.Numeric,reference:"variable",label:this.node.name||(0,n.pgettext)("block:variable","Variable"),exchange:["alias","exportable","precision","digits","decimal","separator","minimum","maximum","prefix","prefixPlural","suffix","suffixPlural"],alias:null==e?void 0:e.alias,exportable:null==e?void 0:e.exportable});break;case"boolean":this.slot=this.slots.static({type:n.Slots.Boolean,reference:"variable",label:this.node.name||(0,n.pgettext)("block:variable","Variable"),exchange:["alias","exportable","labelForTrue","labelForFalse"],alias:null==e?void 0:e.alias,exportable:null==e?void 0:e.exportable});break;case"date":this.slot=this.slots.static({type:n.Slots.Date,reference:"variable",label:this.node.name||(0,n.pgettext)("block:variable","Variable"),exchange:["alias","exportable","precision","minimum","maximum"],alias:null==e?void 0:e.alias,exportable:null==e?void 0:e.exportable}),this.slot.precision||(this.slot.precision="days")}},t.prototype.defineEditor=function(){var e=this,t=this.createProxy((function(){return{textValue:M,numericValue:h,dateValue:w,booleanValue:y}}));this.editor.form({title:(0,n.pgettext)("block:variable","Explanation"),controls:[new n.Forms.Static((0,n.pgettext)("block:variable","Creates a custom variable you can use to store a value in.")).markdown()]}),this.editor.name(!1,!1,(0,n.pgettext)("block:variable","Name"),!1),this.editor.option({name:(0,n.pgettext)("block:variable","Type"),locked:!0,form:{title:(0,n.pgettext)("block:variable","Type"),controls:[new n.Forms.Radiobutton([{label:(0,n.pgettext)("block:variable","Text"),description:(0,n.pgettext)("block:variable","Store a text value."),value:"text"},{label:(0,n.pgettext)("block:variable","Number"),description:(0,n.pgettext)("block:variable","Store a numeric value."),value:"numeric"},{label:(0,n.pgettext)("block:variable","Date"),description:(0,n.pgettext)("block:variable","Store a date value with an optional time."),value:"date"},{label:(0,n.pgettext)("block:variable","Boolean"),description:(0,n.pgettext)("block:variable","Store true or false."),value:"boolean"}],n.Forms.Radiobutton.bind(this,"variableType","text")).on((function(e){(0,n.each)(i,(function(t){t.disabled("text"!==e.value),t.visible("text"===e.value)})),(0,n.each)(d,(function(t){t.disabled("numeric"!==e.value),t.visible("numeric"===e.value)})),(0,n.each)(x,(function(t){t.disabled("date"!==e.value),t.visible("date"===e.value)})),(0,n.each)(g,(function(t){t.disabled("boolean"!==e.value),t.visible("boolean"===e.value)})),M.visible("text"===e.value),h.visible("numeric"===e.value),w.visible("date"===e.value),y.visible("boolean"===e.value),k.disabled("numeric"!==e.value),k.visible("numeric"===e.value)}))]}}),this.editor.groups.settings();var i=[this.editor.option({name:(0,n.pgettext)("block:variable","Limits"),form:{title:(0,n.pgettext)("block:variable","Maximum number of characters"),controls:[new n.Forms.Numeric(n.Forms.Numeric.bind(t,"maxLength",void 0)).min(0)]},activated:(0,n.isNumber)(t.maxLength),visible:"text"===this.variableType,disabled:"text"!==this.variableType}),this.editor.transformations(t).visible("text"===this.variableType).disabled("text"!==this.variableType)],a=new n.Forms.Numeric(n.Forms.Numeric.bind(t,"numericMinimum",void 0)).precision(t.numericPrecision||0).digits(t.digits||0).decimalSign(t.decimal||"").thousands(!!t.separator,t.separator||"").prefix(t.prefix||"").prefixPlural(t.prefixPlural||void 0).suffix(t.suffix||"").suffixPlural(t.suffixPlural||void 0).label((0,n.pgettext)("block:variable","Minimum")),l=new n.Forms.Numeric(n.Forms.Numeric.bind(t,"numericMaximum",void 0)).precision(t.numericPrecision||0).digits(t.digits||0).decimalSign(t.decimal||"").thousands(!!t.separator,t.separator||"").prefix(t.prefix||"").prefixPlural(t.prefixPlural||void 0).suffix(t.suffix||"").suffixPlural(t.suffixPlural||void 0).label((0,n.pgettext)("block:variable","Maximum")),o=new n.Forms.Text("singleline",n.Forms.Text.bind(t,"prefix",void 0)).sanitize(!1).on((function(e){a.prefix(e.isFeatureEnabled&&e.value||""),l.prefix(e.isFeatureEnabled&&e.value||"")})),r=new n.Forms.Text("singleline",n.Forms.Text.bind(t,"prefixPlural",void 0)).indent(32).sanitize(!1).on((function(e){a.prefixPlural(e.isFeatureEnabled&&e.isObservable&&e.value||void 0),l.prefixPlural(e.isFeatureEnabled&&e.isObservable&&e.value||void 0)})).placeholder((0,n.pgettext)("block:variable","Prefix when value is plural")).visible((0,n.isString)(t.prefixPlural)),s=new n.Forms.Text("singleline",n.Forms.Text.bind(t,"suffix",void 0)).sanitize(!1).on((function(e){a.suffix(e.isFeatureEnabled&&e.value||""),l.suffix(e.isFeatureEnabled&&e.value||"")})),c=new n.Forms.Text("singleline",n.Forms.Text.bind(t,"suffixPlural",void 0)).indent(32).sanitize(!1).on((function(e){a.suffixPlural(e.isFeatureEnabled&&e.isObservable&&e.value||void 0),l.suffixPlural(e.isFeatureEnabled&&e.isObservable&&e.value||void 0)})).placeholder((0,n.pgettext)("block:variable","Suffix when value is plural")).visible((0,n.isString)(t.suffixPlural)),u=new n.Forms.Dropdown([{label:"#.#",value:"."},{label:"#,#",value:","}],n.Forms.Dropdown.bind(t,"decimal",void 0)).label((0,n.pgettext)("block:variable","Decimal sign")).disabled(!t.numericPrecision).on((function(e){a.decimalSign(e.isFeatureEnabled&&e.value||""),l.decimalSign(e.isFeatureEnabled&&e.value||"")})),d=[this.editor.option({name:(0,n.pgettext)("block:variable","Format"),form:{title:(0,n.pgettext)("block:variable","Format"),controls:[new n.Forms.Dropdown([{optGroup:(0,n.pgettext)("block:variable","Decimals")},{label:"#",value:0},{label:"#.#",value:1},{label:"#.##",value:2},{label:"#.###",value:3},{label:"#.####",value:4},{label:"#.#####",value:5},{label:"#.######",value:6},{label:"#.#######",value:7},{label:"#.########",value:8},{optGroup:(0,n.pgettext)("block:variable","Digits")},{label:"##",value:-2},{label:"###",value:-3},{label:"####",value:-4},{label:"#####",value:-5},{label:"######",value:-6},{label:"#######",value:-7},{label:"########",value:-8},{label:"#########",value:-9},{label:"##########",value:-10},{label:"###########",value:-11},{label:"############",value:-12},{label:"#############",value:-13},{label:"##############",value:-14},{label:"###############",value:-15},{label:"################",value:-16}],(t.digits?-t.digits:t.numericPrecision)||0).on((function(e){t.numericPrecision=e.isFeatureEnabled&&(0,n.isNumber)(e.value)&&e.value>=0?e.value:void 0,t.digits=e.isFeatureEnabled&&(0,n.isNumber)(e.value)&&e.value<0?-e.value:void 0,a.precision(t.numericPrecision||0),l.precision(t.numericPrecision||0),a.digits(t.digits||0),l.digits(t.digits||0),u.disabled(!t.numericPrecision),v.disabled((t.digits||0)>0)}))]},activated:(0,n.isNumber)(t.numericPrecision)||(0,n.isNumber)(t.digits),visible:"numeric"===this.variableType,disabled:"numeric"!==this.variableType}),this.editor.option({name:(0,n.pgettext)("block:variable","Limits"),form:{title:(0,n.pgettext)("block:variable","Limits"),controls:[a,l]},activated:(0,n.isNumber)(t.numericMinimum)||(0,n.isNumber)(t.numericMaximum),visible:"numeric"===this.variableType,disabled:"numeric"!==this.variableType}),this.editor.option({name:(0,n.pgettext)("block:variable","Prefix"),form:{title:(0,n.pgettext)("block:variable","Prefix"),controls:[o,new n.Forms.Checkbox((0,n.pgettext)("block:variable","Specify different prefix for plural values"),(0,n.isString)(t.prefixPlural)).on((function(e){o.placeholder(e.isChecked&&(0,n.pgettext)("block:variable","Prefix when value is singular")||""),r.visible(e.isChecked)})),r]},activated:(0,n.isString)(t.prefix),visible:"numeric"===this.variableType,disabled:"numeric"!==this.variableType}),this.editor.option({name:(0,n.pgettext)("block:variable","Suffix"),form:{title:(0,n.pgettext)("block:variable","Suffix"),controls:[s,new n.Forms.Checkbox((0,n.pgettext)("block:variable","Specify different suffix for plural values"),(0,n.isString)(t.suffixPlural)).on((function(e){s.placeholder(e.isChecked&&(0,n.pgettext)("block:variable","Suffix when value is singular")||""),c.visible(e.isChecked)})),c]},activated:(0,n.isString)(t.suffix),visible:"numeric"===this.variableType,disabled:"numeric"!==this.variableType})],v=this.editor.option({name:(0,n.pgettext)("block:variable","Signs"),form:{title:(0,n.pgettext)("block:variable","Signs"),controls:[u,new n.Forms.Dropdown([{label:(0,n.pgettext)("block:variable","None"),value:void 0},{label:"#,###",value:","},{label:"#.###",value:"."}],n.Forms.Dropdown.bind(t,"separator",void 0)).label((0,n.pgettext)("block:variable","Thousands separator")).on((function(e){a.thousands(!(!e.isFeatureEnabled||!e.value),e.isFeatureEnabled&&e.value||""),l.thousands(!(!e.isFeatureEnabled||!e.value),e.isFeatureEnabled&&e.value||"")})),new n.Forms.Static((0,n.pgettext)("block:variable","**Note:** These signs are used to format the number in de dataset. When the number is displayed in a runner, the appropriate user locale might be applied making it seem like changing these settings has no effect.")).markdown()]},activated:(0,n.isString)(t.separator)||(0,n.isString)(t.decimal),visible:"numeric"===this.variableType,disabled:"numeric"!==this.variableType||(t.digits||0)>0});d.push(v);var p=function(e){return 1|(e?8:32)},m=new n.Forms.DateTime((0,n.isNumber)(t.dateMinimum)?t.dateMinimum:void 0).zone("UTC").features(p(t.time)).disabled(!0===t.dateMinimum).years((new Date).getFullYear()-150,(new Date).getFullYear()+50).width("full").label((0,n.pgettext)("block:variable","Minimum")).placeholder((0,n.pgettext)("block:variable","Not set")).on((function(){m.isFeatureEnabled?!0!==t.dateMinimum&&(t.dateMinimum=m.value):t.dateMinimum=void 0})),f=new n.Forms.DateTime((0,n.isNumber)(t.dateMaximum)?t.dateMaximum:void 0).zone("UTC").features(p(t.time)).disabled(!0===t.dateMaximum).years((new Date).getFullYear()-150,(new Date).getFullYear()+50).width("full").label((0,n.pgettext)("block:variable","Maximum")).placeholder((0,n.pgettext)("block:variable","Not set")).on((function(){f.isFeatureEnabled?!0!==t.dateMaximum&&(t.dateMaximum=f.value):t.dateMaximum=void 0})),x=[this.editor.option({name:(0,n.pgettext)("block:variable","Time"),form:{title:(0,n.pgettext)("block:variable","Time"),controls:[new n.Forms.Checkbox((0,n.pgettext)("block:variable","Allow a time to be set"),n.Forms.Checkbox.bind(t,"time",void 0,!0)).on((function(e){m.features(p(e.isFeatureEnabled&&e.isChecked)),f.features(p(e.isFeatureEnabled&&e.isChecked))})),new n.Forms.Static((0,n.pgettext)("block:variable","When enabled this will allow to set a specific time along with the date."))]},activated:(0,n.isBoolean)(t.time),visible:"date"===this.variableType,disabled:"date"!==this.variableType}),this.editor.option({name:(0,n.pgettext)("block:variable","Limits"),form:{title:(0,n.pgettext)("block:variable","Limits"),controls:[m,f,new n.Forms.Static((0,n.pgettext)("block:variable","Options")),new n.Forms.Checkbox((0,n.pgettext)("block:variable","Date must be in the future"),!0===t.dateMinimum).on((function(e){e.isFeatureEnabled&&e.isChecked?t.dateMinimum=!0:!0===t.dateMinimum&&(t.dateMinimum=void 0,m.refresh()),m.disabled(!0===t.dateMinimum)})),new n.Forms.Checkbox((0,n.pgettext)("block:variable","Date must be in the past"),!0===t.dateMaximum).on((function(e){e.isFeatureEnabled&&e.isChecked?t.dateMaximum=!0:!0===t.dateMaximum&&(t.dateMaximum=void 0,f.refresh()),f.disabled(!0===t.dateMaximum)}))]},activated:(0,n.isNumber)(t.dateMinimum)||!0===t.dateMinimum||(0,n.isNumber)(t.dateMaximum)||!0===t.dateMaximum,visible:"date"===this.variableType,disabled:"date"!==this.variableType})],g=[this.editor.option({name:(0,n.pgettext)("block:variable","Labels"),form:{title:(0,n.pgettext)("block:variable","Labels"),controls:[new n.Forms.Text("singleline",n.Forms.Text.bind(t,"labelForTrue",void 0)).placeholder("True"),new n.Forms.Text("singleline",n.Forms.Text.bind(t,"labelForFalse",void 0)).placeholder("False"),new n.Forms.Static((0,n.pgettext)("block:variable","These labels will be used in the dataset and override the default values %1 and %2.","**True**","**False**")).markdown()]},activated:(0,n.isString)(t.labelForFalse)||(0,n.isString)(t.labelForTrue),visible:"boolean"===this.variableType,disabled:"boolean"!==this.variableType})];this.editor.groups.options();var M=new n.Forms.Text("multiline","text"===this.variableType&&(0,n.isString)(this.prefill)?this.prefill:void 0).maxLength(t.maxLength||0).transformation(t.transformation||"none").visible("text"===this.variableType).action("@",(0,n.insertVariable)(this,"validated")).on((function(t){t.isObservable&&(e.prefill=t.isFeatureEnabled?t.value:void 0)})),h=new n.Forms.Numeric("numeric"===this.variableType&&(0,n.isNumberFinite)(this.prefill)?this.prefill:void 0).precision(t.numericPrecision||0).digits(t.digits||0).decimalSign(t.decimal||"").thousands(!!t.separator,t.separator||"").prefix(t.prefix||"").prefixPlural(t.prefixPlural||void 0).suffix(t.suffix||"").suffixPlural(t.suffixPlural||void 0).min(t.numericMinimum).max(t.numericMaximum).visible("numeric"===this.variableType).on((function(t){t.isObservable&&(e.prefill=t.isFeatureEnabled?t.value:void 0)})),w=new n.Forms.DateTime("date"===this.variableType&&(0,n.isNumberFinite)(this.prefill)?this.prefill:n.DateTime.UTCToday).features(p(this.slot instanceof n.Slots.Date&&this.slot.supportsTime)).zone("UTC").width("full").required().visible("date"===this.variableType).on((function(t){t.isObservable&&(e.prefill=t.isFeatureEnabled?t.value:void 0)})),y=new n.Forms.Radiobutton([{label:this.slot instanceof n.Slots.Boolean&&this.slot.labelForTrue||(0,n.pgettext)("block:variable","True"),value:!0},{label:this.slot instanceof n.Slots.Boolean&&this.slot.labelForFalse||(0,n.pgettext)("block:variable","False"),value:!1}],!1!==this.prefill).visible("boolean"===this.variableType).on((function(t){t.isObservable&&(e.prefill=t.isFeatureEnabled?t.value:void 0)}));this.editor.option({name:(0,n.pgettext)("block:variable","Prefill"),form:{title:(0,n.pgettext)("block:variable","Prefill"),controls:[M,h,w,y,new n.Forms.Static((0,n.pgettext)("block:variable","This value will be used as initial (prefilled) value for the variable. It is only set once upon creation of the variable."))]},activated:(0,n.isDefined)(this.prefill)});var k=this.editor.option({name:(0,n.pgettext)("block:variable","Calculator"),collection:(0,b.calculator)(this,(0,n.pgettext)("block:variable","Perform calculation on variable value."),(0,n.pgettext)("block:variable","Calculator")),activated:!0===this.calculator,visible:"numeric"===this.variableType}).onToggle((function(){e.calculator=!!k.isActivated||void 0}));this.editor.alias((function(){return e.slot})),this.editor.exportable((function(){return e.slot}))},t.prototype.defineCondition=function(){var e=this;switch(this.variableType){case"text":(0,n.each)([{mode:"exact",label:(0,n.pgettext)("block:variable","Text matches")},{mode:"not-exact",label:(0,n.pgettext)("block:variable","Text does not match")},{mode:"contains",label:(0,n.pgettext)("block:variable","Text contains")},{mode:"not-contains",label:(0,n.pgettext)("block:variable","Text does not contain")},{mode:"starts",label:(0,n.pgettext)("block:variable","Text starts with")},{mode:"ends",label:(0,n.pgettext)("block:variable","Text ends with")},{mode:"defined",label:(0,n.pgettext)("block:variable","Text is not empty")},{mode:"undefined",label:(0,n.pgettext)("block:variable","Text is empty")}],(function(t){e.conditions.template({condition:r.VariableTextCondition,label:t.label,autoOpen:"defined"!==t.mode&&"undefined"!==t.mode,props:{slot:e.slot,mode:t.mode}})}));break;case"numeric":(0,n.each)([{mode:"equal",label:(0,n.pgettext)("block:variable","Number is equal to")},{mode:"not-equal",label:(0,n.pgettext)("block:variable","Number is not equal to")},{mode:"below",label:(0,n.pgettext)("block:variable","Number is lower than")},{mode:"above",label:(0,n.pgettext)("block:variable","Number is higher than")},{mode:"between",label:(0,n.pgettext)("block:variable","Number is between")},{mode:"not-between",label:(0,n.pgettext)("block:variable","Number is not between")},{mode:"defined",label:(0,n.pgettext)("block:variable","Number is not empty")},{mode:"undefined",label:(0,n.pgettext)("block:variable","Number is empty")}],(function(t){e.conditions.template({condition:s.VariableNumericCondition,label:t.label,autoOpen:"defined"!==t.mode&&"undefined"!==t.mode,props:{slot:e.slot,mode:t.mode}})}));break;case"date":(0,n.each)([{mode:"equal",label:(0,n.pgettext)("block:variable","Is equal to")},{mode:"not-equal",label:(0,n.pgettext)("block:variable","Is not equal to")},{mode:"before",label:(0,n.pgettext)("block:variable","Is before")},{mode:"after",label:(0,n.pgettext)("block:variable","Is after")},{mode:"between",label:(0,n.pgettext)("block:variable","Is between")},{mode:"not-between",label:(0,n.pgettext)("block:variable","Is not between")},{mode:"defined",label:(0,n.pgettext)("block:variable","Is not empty")},{mode:"undefined",label:(0,n.pgettext)("block:variable","Is empty")}],(function(t){e.conditions.template({condition:c.VariableDateCondition,label:t.label,autoOpen:"defined"!==t.mode&&"undefined"!==t.mode,props:{slot:e.slot,mode:t.mode,value:e.slot instanceof n.Slots.Date&&e.slot.supportsTime?n.DateTime.UTC:n.DateTime.UTCToday,to:"between"===t.mode||"not-between"===t.mode?e.slot instanceof n.Slots.Date&&e.slot.supportsTime?n.DateTime.UTC:n.DateTime.UTCToday:void 0}})}));break;case"boolean":(0,n.each)([{mode:"true",label:this.slot instanceof n.Slots.Boolean&&this.slot.labelForTrue||(0,n.pgettext)("block:variable","Value is true")},{mode:"false",label:this.slot instanceof n.Slots.Boolean&&this.slot.labelForFalse||(0,n.pgettext)("block:variable","Value is false")},{mode:"equal",label:(0,n.pgettext)("block:variable","Value is equal to")},{mode:"not-equal",label:(0,n.pgettext)("block:variable","Value is not equal to")},{mode:"defined",label:(0,n.pgettext)("block:variable","Value is not empty")},{mode:"undefined",label:(0,n.pgettext)("block:variable","Value is empty")}],(function(t){e.conditions.template({condition:u.VariableBooleanCondition,label:t.label,autoOpen:"equal"===t.mode||"not-equal"===t.mode,props:{slot:e.slot,mode:t.mode}})}))}},o([n.definition],t.prototype,"prefill",void 0),o([n.definition],t.prototype,"calculator",void 0),o([n.definition],t.prototype,"operations",void 0),o([(0,n.affects)("#slots"),(0,n.affects)("#label")],t.prototype,"variableType",null),o([n.slots,n.renamed],t.prototype,"defineSlot",null),o([n.editor],t.prototype,"defineEditor",null),o([n.conditions],t.prototype,"defineCondition",null),t=o([(0,n.tripetto)({type:"node",legacyBlock:!0,identifier:"@tripetto/block-variable",version:"3.0.3",kind:"headless",icon:d.default,get label(){return(0,n.pgettext)("block:variable","Custom variable")}})],t)}(n.NodeBlock);t.Variable=x},755:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),(0,i(954).mountNamespace)("@tripetto/block-variable")},582:function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),(0,i(954).unmountNamespace)()},982:function(e,t,i){i.r(t),t.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSI1ODAiIGhlaWdodD0iNTgwIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgdGV4dC1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiIgaW1hZ2UtcmVuZGVyaW5nPSJvcHRpbWl6ZVF1YWxpdHkiIHZpZXdCb3g9IjAgMCA1ODAwIDU4MDAiPjxwYXRoIGNsYXNzPSJ0cmlwZXR0by1maWxsIiBkPSJNMTkwMCAyOTAwVjEwMDBjMC0xNjUgMTM1LTMwMCAzMDAtMzAwaDE0MDBjMTY1IDAgMzAwIDEzNSAzMDAgMzAwdjE5MDBIMTkwMHptMTEwMC0xODAwaC0yMDB2MTQwMGgyMDBWMTEwMHpNMjIwMCAxMDBoMTQwMGM0OTUgMCA5MDAgNDA1IDkwMCA5MDB2MzgwMGMwIDQ5NS00MDUgOTAwLTkwMCA5MDBIMjIwMGMtNDk1IDAtOTAwLTQwNS05MDAtOTAwVjEwMDBjMC00OTUgNDA1LTkwMCA5MDAtOTAwem0xNDAwIDIwMEgyMjAwYy0zODUgMC03MDAgMzE1LTcwMCA3MDB2MzgwMGMwIDM4NSAzMTUgNzAwIDcwMCA3MDBoMTQwMGMzODUgMCA3MDAtMzE1IDcwMC03MDBWMTAwMGMwLTM4NS0zMTUtNzAwLTcwMC03MDB6bS04MTMgMzAwMGgyMDBjMjc2IDAgNTAwIDIyNSA1MDAgNTAwdjQwNWMwIDI3NS0yMjQgNTAwLTUwMCA1MDBoLTIwMGMtMjc1IDAtNTAwLTIyNS01MDAtNTAwdi00MDVjMC0yNzUgMjI1LTUwMCA1MDAtNTAwem0yMDAgMjAwaC0yMDBjLTE2NSAwLTMwMCAxMzUtMzAwIDMwMHY0MDVjMCAxNjUgMTM1IDMwMCAzMDAgMzAwaDIwMGMxNjUgMCAzMDAtMTM1IDMwMC0zMDB2LTQwNWMwLTE2NS0xMzUtMzAwLTMwMC0zMDB6Ii8+PC9zdmc+"},257:function(e,t,i){i.r(t),t.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PHBhdGggZD0iTTE4LjUgMkgxNnYtLjVhLjUuNSAwIDAgMC0xIDBWMkg1di0uNWEuNS41IDAgMCAwLTEgMFYySDEuNUMuNjczIDIgMCAyLjY3MyAwIDMuNXYxNGMwIC44MjcuNjczIDEuNSAxLjUgMS41aDE3Yy44MjcgMCAxLjUtLjY3MyAxLjUtMS41di0xNGMwLS44MjctLjY3My0xLjUtMS41LTEuNXptLTE3IDFINHYxLjVhLjUuNSAwIDAgMCAxIDBWM2gxMHYxLjVhLjUuNSAwIDAgMCAxIDBWM2gyLjVhLjUuNSAwIDAgMSAuNS41VjZIMVYzLjVhLjUuNSAwIDAgMSAuNS0uNXptMTcgMTVoLTE3YS41LjUgMCAwIDEtLjUtLjVWN2gxOHYxMC41YS41LjUgMCAwIDEtLjUuNXoiIGNsYXNzPSJ0cmlwZXR0by1maW