camunda-bpmn-js 0.13.0-alpha.4 → 0.13.0-alpha.7

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.
@@ -6,6 +6,21 @@
6
6
 
7
7
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
8
 
9
+ function getAugmentedNamespace(n) {
10
+ if (n.__esModule) return n;
11
+ var a = Object.defineProperty({}, '__esModule', {value: true});
12
+ Object.keys(n).forEach(function (k) {
13
+ var d = Object.getOwnPropertyDescriptor(n, k);
14
+ Object.defineProperty(a, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () {
17
+ return n[k];
18
+ }
19
+ });
20
+ });
21
+ return a;
22
+ }
23
+
9
24
  function createCommonjsModule(fn) {
10
25
  var module = { exports: {} };
11
26
  return fn(module, module.exports), module.exports;
@@ -659,6 +674,30 @@
659
674
  callback.cancel = clear;
660
675
  return callback;
661
676
  }
677
+ /**
678
+ * Throttle fn, calling at most once
679
+ * in the given interval.
680
+ *
681
+ * @param {Function} fn
682
+ * @param {Number} interval
683
+ *
684
+ * @return {Function} throttled function
685
+ */
686
+
687
+ function throttle(fn, interval) {
688
+ var throttling = false;
689
+ return function () {
690
+ if (throttling) {
691
+ return;
692
+ }
693
+
694
+ fn.apply(void 0, arguments);
695
+ throttling = true;
696
+ setTimeout(function () {
697
+ throttling = false;
698
+ }, interval);
699
+ };
700
+ }
662
701
  /**
663
702
  * Bind function against target <this>.
664
703
  *
@@ -825,6 +864,94 @@
825
864
  });
826
865
  return result;
827
866
  }
867
+ /**
868
+ * Recursively merge `...sources` into given target.
869
+ *
870
+ * Does support merging objects; does not support merging arrays.
871
+ *
872
+ * @param {Object} target
873
+ * @param {...Object} sources
874
+ *
875
+ * @return {Object} the target
876
+ */
877
+
878
+ function merge(target) {
879
+ for (var _len2 = arguments.length, sources = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
880
+ sources[_key2 - 1] = arguments[_key2];
881
+ }
882
+
883
+ if (!sources.length) {
884
+ return target;
885
+ }
886
+
887
+ forEach(sources, function (source) {
888
+ // skip non-obj sources, i.e. null
889
+ if (!source || !isObject(source)) {
890
+ return;
891
+ }
892
+
893
+ forEach(source, function (sourceVal, key) {
894
+ if (key === '__proto__') {
895
+ return;
896
+ }
897
+
898
+ var targetVal = target[key];
899
+
900
+ if (isObject(sourceVal)) {
901
+ if (!isObject(targetVal)) {
902
+ // override target[key] with object
903
+ targetVal = {};
904
+ }
905
+
906
+ target[key] = merge(targetVal, sourceVal);
907
+ } else {
908
+ target[key] = sourceVal;
909
+ }
910
+ });
911
+ });
912
+ return target;
913
+ }
914
+
915
+ var index_esm = /*#__PURE__*/Object.freeze({
916
+ __proto__: null,
917
+ assign: assign,
918
+ bind: bind,
919
+ debounce: debounce,
920
+ ensureArray: ensureArray,
921
+ every: every,
922
+ filter: filter,
923
+ find: find,
924
+ findIndex: findIndex,
925
+ flatten: flatten,
926
+ forEach: forEach,
927
+ get: get,
928
+ groupBy: groupBy,
929
+ has: has,
930
+ isArray: isArray,
931
+ isDefined: isDefined,
932
+ isFunction: isFunction,
933
+ isNil: isNil,
934
+ isNumber: isNumber,
935
+ isObject: isObject,
936
+ isString: isString,
937
+ isUndefined: isUndefined,
938
+ keys: keys,
939
+ map: map,
940
+ matchPattern: matchPattern,
941
+ merge: merge,
942
+ omit: omit,
943
+ pick: pick,
944
+ reduce: reduce,
945
+ set: set,
946
+ size: size,
947
+ some: some,
948
+ sortBy: sortBy,
949
+ throttle: throttle,
950
+ unionBy: unionBy,
951
+ uniqueBy: uniqueBy,
952
+ values: values,
953
+ without: without
954
+ });
828
955
 
829
956
  /**
830
957
  * Set attribute `name` to `val`, or get attr `name`.
@@ -61408,31 +61535,100 @@
61408
61535
  }());
61409
61536
  });
61410
61537
 
61538
+ function C$1(n,t){for(var e in t)n[e]=t[e];return n}function S$1(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g$2(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S$1(this.props,n)}function r(t){return this.shouldComponentUpdate=e,a(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new p).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S$1(this.props,n)||S$1(this.state,t)};var w$2=n.__b;n.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w$2&&w$2(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x$2(n){function t(t,e){var r=C$1({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var N$1=function(n,t){return null==n?null:w(w(n).map(t))},k$2={map:N$1,forEach:N$1,count:function(n){return n?w(n).length:0},only:function(n){var t=w(n);if(1!==t.length)throw "Children.only";return t[0]},toArray:w},A$2=n.__e;n.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A$2(n,t,e);};var O$1=n.unmount;function L$1(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function D(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n;},function(n){r=n;}),r)throw r;if(!e)throw t;return a(e,u)}return u.displayName="Lazy",u.__f=!0,u}function F$1(){this.u=null,this.o=null;}n.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O$1&&O$1(n);},(L$1.prototype=new p).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L$1.prototype.componentWillUnmount=function(){this.t=[];},L$1.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C$1({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&a(y,null,n.fallback);return u&&(u.__h=null),[a(y,null,t.__e?null:n.children),u]};var M$1=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function T$2(n){return this.getChildContext=function(){return n.context},n.children}function j$2(n){var t=this,e=n.i;t.componentWillUnmount=function(){N(null,t.l),t.l=null,t.i=null;},t.i&&t.i!==e&&t.componentWillUnmount(),n.__v?(t.l||(t.i=e,t.l={nodeType:1,parentNode:e,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n);},insertBefore:function(n,e){this.childNodes.push(n),t.i.appendChild(n);},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n);}}),N(a(T$2,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount();}function I$1(n,t){return a(j$2,{__v:n,i:t})}(F$1.prototype=new p).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),M$1(t,n,r)):u();};e?e(o):o();}},F$1.prototype.render=function(n){this.u=null,this.o=new Map;var t=w(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},F$1.prototype.componentDidUpdate=F$1.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){M$1(n,e,t);});};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P$1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function z$1(n,t,e){return null==t.__k&&(t.textContent=""),N(n,t),"function"==typeof e&&e(),n?n.__c:null}function B(n,t,e){return O(n,t),"function"==typeof e&&e(),n?n.__c:null}p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(p.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H$1=n.event;function Z(){}function Y(){return this.cancelBubble}function $$1(){return this.defaultPrevented}n.event=function(n){return H$1&&(n=H$1(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=$$1,n.nativeEvent=n};var q$1,G={configurable:!0,get:function(){return this.class}},J=n.vnode;n.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"value"===u&&"defaultValue"in e&&null==o||("defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!V(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():P$1.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=w(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=w(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r;}t&&e.class!=e.className&&(G.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",G)),n.$$typeof=W,J&&J(n);};var K=n.__r;n.__r=function(n){K&&K(n),q$1=n.__c;};var Q={ReactCurrentDispatcher:{current:{readContext:function(n){return q$1.__n[n.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()};function fn(n){return a.bind(null,n)}function cn(n){return !!n&&n.$$typeof===W}function an(n){return cn(n)?S.apply(null,arguments):n}function sn(n){return !!n.__k&&(N(null,n),!0)}function hn(n){return n&&(n.base||1===n.nodeType&&n)||null}var pn=function(n,t){return n(t)};var React = {useState:l,useReducer:p$1,useEffect:y$1,useLayoutEffect:h$1,useRef:s$1,useImperativeHandle:_$1,useMemo:d$1,useCallback:A$1,useContext:F,useDebugValue:T$1,version:"16.8.0",Children:k$2,render:z$1,hydrate:B,unmountComponentAtNode:sn,createPortal:I$1,createElement:a,createContext:q,createFactory:fn,cloneElement:an,createRef:h,Fragment:y,isValidElement:cn,findDOMNode:hn,Component:p,PureComponent:E,memo:g$2,forwardRef:x$2,unstable_batchedUpdates:pn,StrictMode:y,Suspense:L$1,SuspenseList:F$1,lazy:D,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Q};
61539
+
61411
61540
  function o$2(_,o,e,n$1,t){var f={};for(var l in o)"ref"!=l&&(f[l]=o[l]);var s,u,a={type:_,props:f,key:e,ref:o&&o.ref,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:++n.__v,__source:n$1,__self:t};if("function"==typeof _&&(s=_.defaultProps))for(u in s)void 0===f[u]&&(f[u]=s[u]);return n.vnode&&n.vnode(a),a}
61412
61541
 
61413
- function C$1(n,t){for(var e in t)n[e]=t[e];return n}function S$1(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g$2(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S$1(this.props,n)}function r(t){return this.shouldComponentUpdate=e,a(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new p).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S$1(this.props,n)||S$1(this.state,t)};var w$2=n.__b;n.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w$2&&w$2(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x$2(n){function t(t,e){var r=C$1({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var N$1=function(n,t){return null==n?null:w(w(n).map(t))},k$2={map:N$1,forEach:N$1,count:function(n){return n?w(n).length:0},only:function(n){var t=w(n);if(1!==t.length)throw "Children.only";return t[0]},toArray:w},A$2=n.__e;n.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A$2(n,t,e);};var O$1=n.unmount;function L$1(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function D(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n;},function(n){r=n;}),r)throw r;if(!e)throw t;return a(e,u)}return u.displayName="Lazy",u.__f=!0,u}function F$1(){this.u=null,this.o=null;}n.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O$1&&O$1(n);},(L$1.prototype=new p).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L$1.prototype.componentWillUnmount=function(){this.t=[];},L$1.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C$1({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&a(y,null,n.fallback);return u&&(u.__h=null),[a(y,null,t.__e?null:n.children),u]};var M$1=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function T$2(n){return this.getChildContext=function(){return n.context},n.children}function j$2(n){var t=this,e=n.i;t.componentWillUnmount=function(){N(null,t.l),t.l=null,t.i=null;},t.i&&t.i!==e&&t.componentWillUnmount(),n.__v?(t.l||(t.i=e,t.l={nodeType:1,parentNode:e,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n);},insertBefore:function(n,e){this.childNodes.push(n),t.i.appendChild(n);},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n);}}),N(a(T$2,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount();}function I$1(n,t){return a(j$2,{__v:n,i:t})}(F$1.prototype=new p).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),M$1(t,n,r)):u();};e?e(o):o();}},F$1.prototype.render=function(n){this.u=null,this.o=new Map;var t=w(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},F$1.prototype.componentDidUpdate=F$1.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){M$1(n,e,t);});};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,P$1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,V=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function z$1(n,t,e){return null==t.__k&&(t.textContent=""),N(n,t),"function"==typeof e&&e(),n?n.__c:null}function B(n,t,e){return O(n,t),"function"==typeof e&&e(),n?n.__c:null}p.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(p.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H$1=n.event;function Z(){}function Y(){return this.cancelBubble}function $$1(){return this.defaultPrevented}n.event=function(n){return H$1&&(n=H$1(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=$$1,n.nativeEvent=n};var q$1,G={configurable:!0,get:function(){return this.class}},J=n.vnode;n.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"value"===u&&"defaultValue"in e&&null==o||("defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!V(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():P$1.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=w(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=w(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r;}t&&e.class!=e.className&&(G.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",G)),n.$$typeof=W,J&&J(n);};var K=n.__r;n.__r=function(n){K&&K(n),q$1=n.__c;};var Q={ReactCurrentDispatcher:{current:{readContext:function(n){return q$1.__n[n.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()};function fn(n){return a.bind(null,n)}function cn(n){return !!n&&n.$$typeof===W}function an(n){return cn(n)?S.apply(null,arguments):n}function sn(n){return !!n.__k&&(N(null,n),!0)}function hn(n){return n&&(n.base||1===n.nodeType&&n)||null}var pn=function(n,t){return n(t)};var React = {useState:l,useReducer:p$1,useEffect:y$1,useLayoutEffect:h$1,useRef:s$1,useImperativeHandle:_$1,useMemo:d$1,useCallback:A$1,useContext:F,useDebugValue:T$1,version:"16.8.0",Children:k$2,render:z$1,hydrate:B,unmountComponentAtNode:sn,createPortal:I$1,createElement:a,createContext:q,createFactory:fn,cloneElement:an,createRef:h,Fragment:y,isValidElement:cn,findDOMNode:hn,Component:p,PureComponent:E,memo:g$2,forwardRef:x$2,unstable_batchedUpdates:pn,StrictMode:y,Suspense:L$1,SuspenseList:F$1,lazy:D,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Q};
61542
+ var ArrowIcon = function ArrowIcon(props) {
61543
+ return o$2("svg", { ...props,
61544
+ children: o$2("path", {
61545
+ fillRule: "evenodd",
61546
+ d: "m11.657 8-4.95 4.95a1 1 0 0 1-1.414-1.414L8.828 8 5.293 4.464A1 1 0 1 1 6.707 3.05L11.657 8z"
61547
+ })
61548
+ });
61549
+ };
61414
61550
 
61415
- /**
61416
- * @typedef { { getElementLabel: Function, getTypeLabel: Function, getElementIcon: Function } } HeaderProvider
61417
- */
61551
+ ArrowIcon.defaultProps = {
61552
+ xmlns: "http://www.w3.org/2000/svg",
61553
+ width: "16",
61554
+ height: "16"
61555
+ };
61556
+
61557
+ var ExternalLinkIcon = function ExternalLinkIcon(props) {
61558
+ return o$2("svg", { ...props,
61559
+ children: o$2("path", {
61560
+ fillRule: "evenodd",
61561
+ clipRule: "evenodd",
61562
+ d: "M12.637 12.637v-4.72h1.362v4.721c0 .36-.137.676-.411.95-.275.275-.591.412-.95.412H3.362c-.38 0-.703-.132-.967-.396A1.315 1.315 0 0 1 2 12.638V3.362c0-.38.132-.703.396-.967S2.982 2 3.363 2h4.553v1.363H3.363v9.274h9.274zM14 2H9.28l-.001 1.362h2.408L5.065 9.984l.95.95 6.622-6.622v2.409H14V2z",
61563
+ fill: "#818798"
61564
+ })
61565
+ });
61566
+ };
61567
+
61568
+ ExternalLinkIcon.defaultProps = {
61569
+ width: "16",
61570
+ height: "16",
61571
+ fill: "none",
61572
+ xmlns: "http://www.w3.org/2000/svg"
61573
+ };
61574
+
61575
+ var FeelRequiredIcon = function FeelRequiredIcon(props) {
61576
+ return o$2("svg", { ...props,
61577
+ children: [o$2("path", {
61578
+ d: "M5.8 7.06V5.95h4.307v1.11H5.8zm0 3.071v-1.11h4.307v1.11H5.8z",
61579
+ fill: "#505562"
61580
+ }), o$2("path", {
61581
+ fillRule: "evenodd",
61582
+ clipRule: "evenodd",
61583
+ d: "M8 3.268A4.732 4.732 0 1 0 12.732 8H14a6 6 0 1 1-6-6v1.268z",
61584
+ fill: "#505562"
61585
+ }), o$2("path", {
61586
+ d: "m11.28 6.072-.832-.56 1.016-1.224L10 3.848l.312-.912 1.392.584L11.632 2h1.032l-.072 1.52 1.392-.584.312.912-1.464.44 1.008 1.224-.832.552-.864-1.296-.864 1.304z",
61587
+ fill: "#505562"
61588
+ })]
61589
+ });
61590
+ };
61591
+
61592
+ FeelRequiredIcon.defaultProps = {
61593
+ viewBox: "0 0 16 16",
61594
+ fill: "none",
61595
+ xmlns: "http://www.w3.org/2000/svg"
61596
+ };
61597
+
61598
+ var FeelOptionalIcon = function FeelOptionalIcon(props) {
61599
+ return o$2("svg", { ...props,
61600
+ children: [o$2("path", {
61601
+ d: "M5.845 7.04V5.93h4.307v1.11H5.845zm0 3.07V9h4.307v1.11H5.845z",
61602
+ fill: "#505562"
61603
+ }), o$2("path", {
61604
+ fillRule: "evenodd",
61605
+ clipRule: "evenodd",
61606
+ d: "M3.286 8a4.714 4.714 0 1 0 9.428 0 4.714 4.714 0 0 0-9.428 0zM8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2z",
61607
+ fill: "#505562"
61608
+ })]
61609
+ });
61610
+ };
61611
+
61612
+ FeelOptionalIcon.defaultProps = {
61613
+ viewBox: "0 0 16 16",
61614
+ fill: "none",
61615
+ xmlns: "http://www.w3.org/2000/svg"
61616
+ };
61418
61617
 
61419
- /**
61420
- * @param {Object} props
61421
- * @param {Object} props.element,
61422
- * @param {HeaderProvider} props.headerProvider
61423
- */
61424
61618
  function Header(props) {
61425
61619
  const {
61426
61620
  element,
61427
61621
  headerProvider
61428
61622
  } = props;
61429
61623
  const {
61624
+ getElementIcon,
61625
+ getDocumentationRef,
61430
61626
  getElementLabel,
61431
- getTypeLabel,
61432
- getElementIcon
61627
+ getTypeLabel
61433
61628
  } = headerProvider;
61434
61629
  const label = getElementLabel(element);
61435
61630
  const type = getTypeLabel(element);
61631
+ const documentationRef = getDocumentationRef && getDocumentationRef(element);
61436
61632
  const ElementIcon = getElementIcon(element);
61437
61633
  return o$2("div", {
61438
61634
  class: "bio-properties-panel-header",
@@ -61449,35 +61645,48 @@
61449
61645
  title: type,
61450
61646
  class: "bio-properties-panel-header-type",
61451
61647
  children: type
61452
- }), getElementLabel(element) ? o$2("div", {
61648
+ }), label ? o$2("div", {
61453
61649
  title: label,
61454
61650
  class: "bio-properties-panel-header-label",
61455
61651
  children: label
61456
61652
  }) : null]
61653
+ }), o$2("div", {
61654
+ class: "bio-properties-panel-header-actions",
61655
+ children: documentationRef ? o$2("a", {
61656
+ rel: "noopener",
61657
+ class: "bio-properties-panel-header-link",
61658
+ href: documentationRef,
61659
+ title: "Open documentation",
61660
+ target: "_blank",
61661
+ children: o$2(ExternalLinkIcon, {})
61662
+ }) : null
61457
61663
  })]
61458
61664
  });
61459
61665
  }
61460
61666
 
61461
- /**
61462
- * @pinussilvestrus: we need to introduce our own hook to persist the previous
61463
- * state on updates.
61464
- *
61465
- * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
61466
- */
61467
-
61468
- function usePrevious(value) {
61469
- const ref = s$1();
61470
- y$1(() => {
61471
- ref.current = value;
61472
- });
61473
- return ref.current;
61474
- }
61475
-
61476
61667
  const DescriptionContext = q({
61477
61668
  description: {},
61478
61669
  getDescriptionForId: () => {}
61479
61670
  });
61480
61671
 
61672
+ /**
61673
+ * @typedef {Function} <propertiesPanel.showEntry> callback
61674
+ *
61675
+ * @example
61676
+ *
61677
+ * useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
61678
+ * // ...
61679
+ * });
61680
+ *
61681
+ * @param {Object} context
61682
+ * @param {boolean} [context.focus]
61683
+ *
61684
+ * @returns void
61685
+ */
61686
+ const EventContext = q({
61687
+ eventBus: null
61688
+ });
61689
+
61481
61690
  const LayoutContext = q({
61482
61691
  layout: {},
61483
61692
  setLayout: () => {},
@@ -61485,6 +61694,107 @@
61485
61694
  setLayoutForKey: () => {}
61486
61695
  });
61487
61696
 
61697
+ /**
61698
+ * Accesses the global DescriptionContext and returns a description for a given id and element.
61699
+ *
61700
+ * @example
61701
+ * ```jsx
61702
+ * function TextField(props) {
61703
+ * const description = useDescriptionContext('input1', element);
61704
+ * }
61705
+ * ```
61706
+ *
61707
+ * @param {string} id
61708
+ * @param {djs.model.Base} element
61709
+ *
61710
+ * @returns {string}
61711
+ */
61712
+
61713
+ function useDescriptionContext(id, element) {
61714
+ const {
61715
+ getDescriptionForId
61716
+ } = F(DescriptionContext);
61717
+ return getDescriptionForId(id, element);
61718
+ }
61719
+
61720
+ const DEFAULT_PRIORITY$6 = 1000;
61721
+ /**
61722
+ * Subscribe to an event.
61723
+ *
61724
+ * @param {string} event
61725
+ * @param {Function} callback
61726
+ * @param {number} [priority]
61727
+ *
61728
+ * @returns {import('preact').Ref}
61729
+ */
61730
+
61731
+ function useEvent(event, callback, priority = DEFAULT_PRIORITY$6) {
61732
+ const {
61733
+ eventBus
61734
+ } = F(EventContext);
61735
+ y$1(() => {
61736
+ if (!eventBus) {
61737
+ return;
61738
+ }
61739
+
61740
+ eventBus.on(event, priority, callback);
61741
+ return () => eventBus.off(event, callback);
61742
+ }, [callback, event, eventBus, priority]);
61743
+ }
61744
+
61745
+ const HIGH_PRIORITY$l = 10000;
61746
+ /**
61747
+ * Buffer events and re-fire during passive effect phase.
61748
+ *
61749
+ * @param {string[]} bufferedEvents
61750
+ * @param {Object} [eventBus]
61751
+ */
61752
+
61753
+ function useEventBuffer(bufferedEvents, eventBus) {
61754
+ const buffer = s$1([]),
61755
+ buffering = s$1(true);
61756
+
61757
+ const createCallback = event => data => {
61758
+ if (buffering.current === true) {
61759
+ buffer.current.unshift([event, data]);
61760
+ }
61761
+ }; // (1) buffer events
61762
+
61763
+
61764
+ y$1(() => {
61765
+ if (!eventBus) {
61766
+ return;
61767
+ }
61768
+
61769
+ const listeners = bufferedEvents.map(event => {
61770
+ return [event, createCallback(event)];
61771
+ });
61772
+ listeners.forEach(([event, callback]) => {
61773
+ eventBus.on(event, HIGH_PRIORITY$l, callback);
61774
+ });
61775
+ return () => {
61776
+ listeners.forEach(([event, callback]) => {
61777
+ eventBus.off(event, callback);
61778
+ });
61779
+ };
61780
+ }, [bufferedEvents, eventBus]); // (2) re-fire events
61781
+
61782
+ y$1(() => {
61783
+ if (!eventBus) {
61784
+ return;
61785
+ }
61786
+
61787
+ buffering.current = false;
61788
+
61789
+ while (buffer.current.length) {
61790
+ const [event, data] = buffer.current.pop();
61791
+ eventBus.fire(event, data);
61792
+ }
61793
+
61794
+ buffering.current = true;
61795
+ });
61796
+ }
61797
+
61488
61798
  /**
61489
61799
  * Creates a state that persists in the global LayoutContext.
61490
61800
  *
@@ -61520,51 +61830,104 @@
61520
61830
  }
61521
61831
 
61522
61832
  /**
61523
- * Accesses the global DescriptionContext and returns a description for a given id and element.
61833
+ * @pinussilvestrus: we need to introduce our own hook to persist the previous
61834
+ * state on updates.
61524
61835
  *
61525
- * @example
61526
- * ```jsx
61527
- * function TextField(props) {
61528
- * const description = useDescriptionContext('input1', element);
61529
- * }
61530
- * ```
61836
+ * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
61837
+ */
61838
+
61839
+ function usePrevious(value) {
61840
+ const ref = s$1();
61841
+ y$1(() => {
61842
+ ref.current = value;
61843
+ });
61844
+ return ref.current;
61845
+ }
61846
+
61847
+ /**
61848
+ * Subscribe to `propertiesPanel.showEntry`.
61531
61849
  *
61532
- * @param {string} id
61533
- * @param {djs.model.Base} element
61850
+ * @param {Function} show
61534
61851
  *
61535
- * @returns {string}
61852
+ * @returns {import('preact').Ref}
61536
61853
  */
61537
61854
 
61538
- function useDescriptionContext(id, element) {
61855
+ function useShowEntryEvent(show) {
61539
61856
  const {
61540
- getDescriptionForId
61541
- } = F(DescriptionContext);
61542
- return getDescriptionForId(id, element);
61857
+ onShow
61858
+ } = F(LayoutContext);
61859
+ const ref = s$1();
61860
+ const [focus, setFocus] = l(false);
61861
+ const onShowEntry = A$1(event => {
61862
+ if (show(event)) {
61863
+ if (isFunction(onShow)) {
61864
+ onShow();
61865
+ }
61866
+
61867
+ if (event.focus && !focus) {
61868
+ setFocus(true);
61869
+ }
61870
+ }
61871
+ }, [show]);
61872
+ y$1(() => {
61873
+ if (focus && ref.current) {
61874
+ if (isFunction(ref.current.focus)) {
61875
+ ref.current.focus();
61876
+ }
61877
+
61878
+ if (isFunction(ref.current.select)) {
61879
+ ref.current.select();
61880
+ }
61881
+
61882
+ setFocus(false);
61883
+ }
61884
+ }, [focus]);
61885
+ useEvent('propertiesPanel.showEntry', onShowEntry);
61886
+ return ref;
61543
61887
  }
61544
61888
 
61545
- var ArrowIcon = function ArrowIcon(props) {
61546
- return o$2("svg", { ...props,
61547
- children: o$2("path", {
61548
- fillRule: "evenodd",
61549
- d: "m11.657 8-4.95 4.95a1 1 0 0 1-1.414-1.414L8.828 8 5.293 4.464A1 1 0 1 1 6.707 3.05L11.657 8z"
61550
- })
61551
- });
61552
- };
61889
+ /**
61890
+ * Subscribe to `propertiesPanel.showError`. On `propertiesPanel.showError` set
61891
+ * temporary error. Fire `propertiesPanel.showEntry` for temporary error to be
61892
+ * visible. Unset error on `propertiesPanel.updated`.
61893
+ *
61894
+ * @param {Function} show
61895
+ *
61896
+ * @returns {import('preact').Ref}
61897
+ */
61553
61898
 
61554
- ArrowIcon.defaultProps = {
61555
- xmlns: "http://www.w3.org/2000/svg",
61556
- width: "16",
61557
- height: "16"
61558
- };
61899
+ function useShowErrorEvent(show) {
61900
+ const {
61901
+ eventBus
61902
+ } = F(EventContext);
61903
+ const [temporaryError, setTemporaryError] = l(null);
61904
+ const onPropertiesPanelUpdated = A$1(() => setTemporaryError(null), []);
61905
+ useEvent('propertiesPanel.updated', onPropertiesPanelUpdated);
61906
+ const onShowError = A$1(event => {
61907
+ setTemporaryError(null);
61908
+
61909
+ if (show(event)) {
61910
+ if (eventBus) {
61911
+ eventBus.fire('propertiesPanel.showEntry', event);
61912
+ }
61913
+
61914
+ setTemporaryError(event.message);
61915
+ }
61916
+ }, [show]);
61917
+ useEvent('propertiesPanel.showError', onShowError);
61918
+ return temporaryError;
61919
+ }
61559
61920
 
61560
61921
  function Group(props) {
61561
61922
  const {
61562
61923
  element,
61563
61924
  entries = [],
61564
61925
  id,
61565
- label
61926
+ label,
61927
+ shouldOpen = false
61566
61928
  } = props;
61567
- const [open, setOpen] = useLayoutState(['groups', id, 'open'], false);
61929
+ const [open, setOpen] = useLayoutState(['groups', id, 'open'], shouldOpen);
61930
+ const onShow = A$1(() => setOpen(true), [setOpen]);
61568
61931
 
61569
61932
  const toggleOpen = () => setOpen(!open);
61570
61933
 
@@ -61587,6 +61950,9 @@
61587
61950
  });
61588
61951
  setEdited(hasOneEditedEntry);
61589
61952
  }, [entries]);
61953
+ const propertiesPanelContext = { ...F(LayoutContext),
61954
+ onShow
61955
+ };
61590
61956
  return o$2("div", {
61591
61957
  class: "bio-properties-panel-group",
61592
61958
  "data-group-id": 'group-' + id,
@@ -61609,15 +61975,18 @@
61609
61975
  })]
61610
61976
  }), o$2("div", {
61611
61977
  class: classnames('bio-properties-panel-group-entries', open ? 'open' : ''),
61612
- children: entries.map(entry => {
61613
- const {
61614
- component: Component,
61615
- id
61616
- } = entry;
61617
- return a(Component, { ...entry,
61618
- key: id,
61619
- element: element
61620
- });
61978
+ children: o$2(LayoutContext.Provider, {
61979
+ value: propertiesPanelContext,
61980
+ children: entries.map(entry => {
61981
+ const {
61982
+ component: Component,
61983
+ id
61984
+ } = entry;
61985
+ return a(Component, { ...entry,
61986
+ element: element,
61987
+ key: id
61988
+ });
61989
+ })
61621
61990
  })
61622
61991
  })]
61623
61992
  });
@@ -61634,6 +62003,7 @@
61634
62003
  open: true
61635
62004
  };
61636
62005
  const DEFAULT_DESCRIPTION = {};
62006
+ const bufferedEvents = ['propertiesPanel.showEntry', 'propertiesPanel.showError'];
61637
62007
  /**
61638
62008
  * @typedef { {
61639
62009
  * component: import('preact').Component,
@@ -61665,7 +62035,8 @@
61665
62035
  * component?: import('preact').Component,
61666
62036
  * entries: Array<EntryDefinition>,
61667
62037
  * id: String,
61668
- * label: String
62038
+ * label: String,
62039
+ * shouldOpen?: Boolean
61669
62040
  * } } GroupDefinition
61670
62041
  *
61671
62042
  * @typedef { {
@@ -61692,6 +62063,7 @@
61692
62063
  * @param {Function} [props.layoutChanged]
61693
62064
  * @param {DescriptionConfig} [props.descriptionConfig]
61694
62065
  * @param {Function} [props.descriptionLoaded]
62066
+ * @param {Object} [props.eventBus]
61695
62067
  */
61696
62068
 
61697
62069
  function PropertiesPanel(props) {
@@ -61702,7 +62074,8 @@
61702
62074
  layoutConfig = {},
61703
62075
  layoutChanged,
61704
62076
  descriptionConfig = {},
61705
- descriptionLoaded
62077
+ descriptionLoaded,
62078
+ eventBus
61706
62079
  } = props; // set-up layout context
61707
62080
 
61708
62081
  const [layout, setLayout] = l(createLayout(layoutConfig));
@@ -61743,6 +62116,13 @@
61743
62116
  description,
61744
62117
  getDescriptionForId
61745
62118
  };
62119
+ useEventBuffer(bufferedEvents, eventBus);
62120
+ const eventContext = {
62121
+ eventBus
62122
+ };
62123
+ const propertiesPanelContext = {
62124
+ element
62125
+ };
61746
62126
 
61747
62127
  if (!element) {
61748
62128
  return o$2("div", {
@@ -61751,28 +62131,34 @@
61751
62131
  });
61752
62132
  }
61753
62133
 
61754
- return o$2(DescriptionContext.Provider, {
61755
- value: descriptionContext,
61756
- children: o$2(LayoutContext.Provider, {
61757
- value: layoutContext,
61758
- children: o$2("div", {
61759
- class: classnames('bio-properties-panel', layout.open ? 'open' : ''),
61760
- children: [o$2(Header, {
61761
- element: element,
61762
- headerProvider: headerProvider
61763
- }), o$2("div", {
61764
- class: "bio-properties-panel-scroll-container",
61765
- children: groups.map(group => {
61766
- const {
61767
- component: Component = Group,
61768
- id
61769
- } = group;
61770
- return a(Component, { ...group,
61771
- key: id,
61772
- element: element
61773
- });
62134
+ return o$2(LayoutContext.Provider, {
62135
+ value: propertiesPanelContext,
62136
+ children: o$2(DescriptionContext.Provider, {
62137
+ value: descriptionContext,
62138
+ children: o$2(LayoutContext.Provider, {
62139
+ value: layoutContext,
62140
+ children: o$2(EventContext.Provider, {
62141
+ value: eventContext,
62142
+ children: o$2("div", {
62143
+ class: classnames('bio-properties-panel', layout.open ? 'open' : ''),
62144
+ children: [o$2(Header, {
62145
+ element: element,
62146
+ headerProvider: headerProvider
62147
+ }), o$2("div", {
62148
+ class: "bio-properties-panel-scroll-container",
62149
+ children: groups.map(group => {
62150
+ const {
62151
+ component: Component = Group,
62152
+ id
62153
+ } = group;
62154
+ return a(Component, { ...group,
62155
+ key: id,
62156
+ element: element
62157
+ });
62158
+ })
62159
+ })]
61774
62160
  })
61775
- })]
62161
+ })
61776
62162
  })
61777
62163
  })
61778
62164
  });
@@ -61807,13 +62193,16 @@
61807
62193
  }
61808
62194
  }
61809
62195
 
62196
+ const noop$2 = () => {};
62197
+
61810
62198
  function Checkbox(props) {
61811
62199
  const {
61812
62200
  id,
61813
62201
  label,
61814
62202
  onChange,
61815
62203
  disabled,
61816
- value = false
62204
+ value = false,
62205
+ show = noop$2
61817
62206
  } = props;
61818
62207
 
61819
62208
  const handleChange = ({
@@ -61822,9 +62211,11 @@
61822
62211
  onChange(target.checked);
61823
62212
  };
61824
62213
 
62214
+ const ref = useShowEntryEvent(show);
61825
62215
  return o$2("div", {
61826
62216
  class: "bio-properties-panel-checkbox",
61827
62217
  children: [o$2("input", {
62218
+ ref: ref,
61828
62219
  id: prefixId$6(id),
61829
62220
  name: id,
61830
62221
  type: "checkbox",
@@ -61859,18 +62250,24 @@
61859
62250
  label,
61860
62251
  getValue,
61861
62252
  setValue,
61862
- disabled
62253
+ disabled,
62254
+ show = noop$2
61863
62255
  } = props;
61864
62256
  const value = getValue(element);
62257
+ const error = useShowErrorEvent(show);
61865
62258
  return o$2("div", {
61866
62259
  class: "bio-properties-panel-entry bio-properties-panel-checkbox-entry",
61867
62260
  "data-entry-id": id,
61868
62261
  children: [o$2(Checkbox, {
62262
+ disabled: disabled,
61869
62263
  id: id,
61870
62264
  label: label,
61871
62265
  onChange: setValue,
61872
- value: value,
61873
- disabled: disabled
62266
+ show: show,
62267
+ value: value
62268
+ }), error && o$2("div", {
62269
+ class: "bio-properties-panel-error",
62270
+ children: error
61874
62271
  }), o$2(Description, {
61875
62272
  forId: id,
61876
62273
  element: element,
@@ -61886,6 +62283,25 @@
61886
62283
  return `bio-properties-panel-${id}`;
61887
62284
  }
61888
62285
 
62286
+ const noop$1 = () => {};
62287
+ /**
62288
+ * @typedef { { value: string, label: string, disabled: boolean } } Option
62289
+ */
62290
+
62291
+ /**
62292
+ * Provides basic select input.
62293
+ *
62294
+ * @param {object} props
62295
+ * @param {string} props.id
62296
+ * @param {string[]} props.path
62297
+ * @param {string} props.label
62298
+ * @param {Function} props.onChange
62299
+ * @param {Array<Option>} [props.options]
62300
+ * @param {string} props.value
62301
+ * @param {boolean} [props.disabled]
62302
+ */
62303
+
62304
+
61889
62305
  function Select(props) {
61890
62306
  const {
61891
62307
  id,
@@ -61893,8 +62309,10 @@
61893
62309
  onChange,
61894
62310
  options = [],
61895
62311
  value,
61896
- disabled
62312
+ disabled,
62313
+ show = noop$1
61897
62314
  } = props;
62315
+ const ref = useShowEntryEvent(show);
61898
62316
 
61899
62317
  const handleChange = ({
61900
62318
  target
@@ -61909,6 +62327,7 @@
61909
62327
  class: "bio-properties-panel-label",
61910
62328
  children: label
61911
62329
  }), o$2("select", {
62330
+ ref: ref,
61912
62331
  id: prefixId$4(id),
61913
62332
  name: id,
61914
62333
  class: "bio-properties-panel-input",
@@ -61947,12 +62366,14 @@
61947
62366
  getValue,
61948
62367
  setValue,
61949
62368
  getOptions,
61950
- disabled
62369
+ disabled,
62370
+ show = noop$1
61951
62371
  } = props;
61952
62372
  const value = getValue(element);
61953
62373
  const options = getOptions(element);
62374
+ const error = useShowErrorEvent(show);
61954
62375
  return o$2("div", {
61955
- class: "bio-properties-panel-entry",
62376
+ class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
61956
62377
  "data-entry-id": id,
61957
62378
  children: [o$2(Select, {
61958
62379
  id: id,
@@ -61960,7 +62381,11 @@
61960
62381
  value: value,
61961
62382
  onChange: setValue,
61962
62383
  options: options,
61963
- disabled: disabled
62384
+ disabled: disabled,
62385
+ show: show
62386
+ }), error && o$2("div", {
62387
+ class: "bio-properties-panel-error",
62388
+ children: error
61964
62389
  }), o$2(Description, {
61965
62390
  forId: id,
61966
62391
  element: element,
@@ -61976,12 +62401,27 @@
61976
62401
  return `bio-properties-panel-${id}`;
61977
62402
  }
61978
62403
 
62404
+ function FeelIcon(props) {
62405
+ const {
62406
+ label,
62407
+ feel = false
62408
+ } = props;
62409
+ const feelRequiredLabel = ' must be a FEEL expression';
62410
+ const feelOptionalLabel = ' can optionally be a FEEL expression';
62411
+ return o$2("i", {
62412
+ class: "bio-properties-panel-feel-icon",
62413
+ title: label + (feel === 'required' ? feelRequiredLabel : feelOptionalLabel),
62414
+ children: feel === 'required' ? o$2(FeelRequiredIcon, {}) : o$2(FeelOptionalIcon, {})
62415
+ });
62416
+ }
62417
+
61979
62418
  function TextArea(props) {
61980
62419
  const {
61981
62420
  id,
61982
62421
  label,
61983
62422
  rows = 2,
61984
62423
  debounce,
62424
+ feel,
61985
62425
  onInput,
61986
62426
  value = '',
61987
62427
  disabled,
@@ -61997,7 +62437,10 @@
61997
62437
  children: [o$2("label", {
61998
62438
  for: prefixId$2(id),
61999
62439
  class: "bio-properties-panel-label",
62000
- children: label
62440
+ children: [label, feel && o$2(FeelIcon, {
62441
+ feel: feel,
62442
+ label: label
62443
+ })]
62001
62444
  }), o$2("textarea", {
62002
62445
  id: prefixId$2(id),
62003
62446
  name: id,
@@ -62033,6 +62476,7 @@
62033
62476
  id,
62034
62477
  description,
62035
62478
  debounce,
62479
+ feel,
62036
62480
  label,
62037
62481
  getValue,
62038
62482
  setValue,
@@ -62052,6 +62496,7 @@
62052
62496
  rows: rows,
62053
62497
  debounce: debounce,
62054
62498
  monospace: monospace,
62499
+ feel: feel,
62055
62500
  disabled: disabled
62056
62501
  }), o$2(Description, {
62057
62502
  forId: id,
@@ -62068,6 +62513,8 @@
62068
62513
  return `bio-properties-panel-${id}`;
62069
62514
  }
62070
62515
 
62516
+ const noop = () => {};
62517
+
62071
62518
  function Textfield(props) {
62072
62519
  const {
62073
62520
  debounce,
@@ -62075,8 +62522,11 @@
62075
62522
  id,
62076
62523
  label,
62077
62524
  onInput,
62078
- value = ''
62525
+ feel = false,
62526
+ value = '',
62527
+ show = noop
62079
62528
  } = props;
62529
+ const ref = useShowEntryEvent(show);
62080
62530
  const handleInput = d$1(() => {
62081
62531
  return debounce(({
62082
62532
  target
@@ -62087,8 +62537,12 @@
62087
62537
  children: [o$2("label", {
62088
62538
  for: prefixId$1(id),
62089
62539
  class: "bio-properties-panel-label",
62090
- children: label
62540
+ children: [label, feel && o$2(FeelIcon, {
62541
+ feel: feel,
62542
+ label: label
62543
+ })]
62091
62544
  }), o$2("input", {
62545
+ ref: ref,
62092
62546
  id: prefixId$1(id),
62093
62547
  type: "text",
62094
62548
  name: id,
@@ -62124,55 +62578,65 @@
62124
62578
  description,
62125
62579
  debounce,
62126
62580
  disabled,
62581
+ feel,
62127
62582
  label,
62128
62583
  getValue,
62129
62584
  setValue,
62130
- validate
62585
+ validate,
62586
+ show = noop
62131
62587
  } = props;
62132
- const [error, setError] = l(null);
62133
- const [invalidValueCache, setInvalidValueCache] = l(null);
62588
+ const [cachedInvalidValue, setCachedInvalidValue] = l(null);
62589
+ const [validationError, setValidationError] = l(null);
62134
62590
  let value = getValue(element);
62135
- const prevValue = usePrevious(value); // validate again when value prop changed
62136
-
62591
+ const previousValue = usePrevious(value);
62137
62592
  y$1(() => {
62138
- const err = validate ? validate(value) : null;
62139
- setError(err);
62140
- }, [value]); // validate on change
62593
+ if (isFunction(validate)) {
62594
+ const newValidationError = validate(value) || null;
62595
+ setValidationError(newValidationError);
62596
+ }
62597
+ }, [value]);
62141
62598
 
62142
- const handleChange = newValue => {
62143
- const err = validate ? validate(newValue) : null;
62599
+ const onInput = newValue => {
62600
+ let newValidationError = null;
62144
62601
 
62145
- if (err) {
62146
- setInvalidValueCache(newValue);
62602
+ if (isFunction(validate)) {
62603
+ newValidationError = validate(newValue) || null;
62604
+ }
62605
+
62606
+ if (newValidationError) {
62607
+ setCachedInvalidValue(newValue);
62147
62608
  } else {
62148
62609
  setValue(newValue);
62149
62610
  }
62150
62611
 
62151
- setError(err);
62152
- }; // keep showing invalid value on errors, although it was not set
62153
-
62612
+ setValidationError(newValidationError);
62613
+ };
62154
62614
 
62155
- if (prevValue === value && error) {
62156
- value = invalidValueCache;
62615
+ if (previousValue === value && validationError) {
62616
+ value = cachedInvalidValue;
62157
62617
  }
62158
62618
 
62619
+ const temporaryError = useShowErrorEvent(show);
62620
+ const error = temporaryError || validationError;
62159
62621
  return o$2("div", {
62160
62622
  class: classnames('bio-properties-panel-entry', error ? 'has-error' : ''),
62161
62623
  "data-entry-id": id,
62162
62624
  children: [o$2(Textfield, {
62625
+ debounce: debounce,
62626
+ disabled: disabled,
62627
+ feel: feel,
62163
62628
  id: id,
62164
62629
  label: label,
62165
- value: value,
62166
- onInput: handleChange,
62167
- debounce: debounce,
62168
- disabled: disabled
62630
+ onInput: onInput,
62631
+ show: show,
62632
+ value: value
62633
+ }), error && o$2("div", {
62634
+ class: "bio-properties-panel-error",
62635
+ children: error
62169
62636
  }), o$2(Description, {
62170
62637
  forId: id,
62171
62638
  element: element,
62172
62639
  value: description
62173
- }), error && o$2("div", {
62174
- class: "bio-properties-panel-error",
62175
- children: error
62176
62640
  })]
62177
62641
  });
62178
62642
  }
@@ -62201,2792 +62665,264 @@
62201
62665
  debounceInput: ['factory', debounceInput]
62202
62666
  };
62203
62667
 
62204
- /**
62205
- * Failsafe remove an element from a collection
62206
- *
62207
- * @param {Array<Object>} [collection]
62208
- * @param {Object} [element]
62209
- *
62210
- * @return {number} the previous index of the element
62211
- */
62668
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_esm);
62669
+
62670
+ const {
62671
+ isNil: isNil$1,
62672
+ isString: isString$1,
62673
+ isUndefined: isUndefined$2
62674
+ } = require$$0;
62212
62675
 
62213
62676
  /**
62214
- * Fail save add an element to the given connection, ensuring
62215
- * it does not yet exist.
62677
+ * Get path from model element and optional parent model element. Falls back to
62678
+ * returning null.
62216
62679
  *
62217
- * @param {Array<Object>} collection
62218
- * @param {Object} element
62219
- * @param {number} idx
62680
+ * @param {ModdleElement} moddleElement
62681
+ * @param {ModdleElement} [parentModdleElement]
62682
+ *
62683
+ * @returns {string[]|null}
62220
62684
  */
62221
- function add$2(collection, element, idx) {
62222
-
62223
- if (!collection || !element) {
62224
- return;
62685
+ var getPath = function(moddleElement, parentModdleElement) {
62686
+ if (!moddleElement) {
62687
+ return null;
62225
62688
  }
62226
62689
 
62227
- if (typeof idx !== 'number') {
62228
- idx = -1;
62690
+ if (moddleElement === parentModdleElement) {
62691
+ return [];
62229
62692
  }
62230
62693
 
62231
- var currentIdx = collection.indexOf(element);
62232
-
62233
- if (currentIdx !== -1) {
62234
-
62235
- if (currentIdx === idx) {
62236
-
62237
- // nothing to do, position has not changed
62238
- return;
62239
- } else {
62694
+ let path = [],
62695
+ parent;
62240
62696
 
62241
- if (idx !== -1) {
62697
+ do {
62698
+ parent = moddleElement.$parent;
62242
62699
 
62243
- // remove from current position
62244
- collection.splice(currentIdx, 1);
62700
+ if (!parent) {
62701
+ if (moddleElement.$instanceOf('bpmn:Definitions')) {
62702
+ break;
62245
62703
  } else {
62246
-
62247
- // already exists in collection
62248
- return;
62704
+ return null;
62249
62705
  }
62250
62706
  }
62251
- }
62252
-
62253
- if (idx !== -1) {
62254
-
62255
- // insert at specified position
62256
- collection.splice(idx, 0, element);
62257
- } else {
62258
-
62259
- // push to end
62260
- collection.push(element);
62261
- }
62262
- }
62263
-
62264
- // Note: this is the semver.org version of the spec that it implements
62265
- // Not necessarily the package version of this code.
62266
- const SEMVER_SPEC_VERSION = '2.0.0';
62267
-
62268
- const MAX_LENGTH = 256;
62269
- const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
62270
- /* istanbul ignore next */ 9007199254740991;
62271
-
62272
- // Max safe segment length for coercion.
62273
- const MAX_SAFE_COMPONENT_LENGTH = 16;
62274
-
62275
- var constants = {
62276
- SEMVER_SPEC_VERSION,
62277
- MAX_LENGTH,
62278
- MAX_SAFE_INTEGER,
62279
- MAX_SAFE_COMPONENT_LENGTH
62280
- };
62281
-
62282
- const debug = (
62283
- typeof process === 'object' &&
62284
- process.env &&
62285
- process.env.NODE_DEBUG &&
62286
- /\bsemver\b/i.test(process.env.NODE_DEBUG)
62287
- ) ? (...args) => console.error('SEMVER', ...args)
62288
- : () => {};
62289
-
62290
- var debug_1 = debug;
62291
-
62292
- var re_1 = createCommonjsModule(function (module, exports) {
62293
- const { MAX_SAFE_COMPONENT_LENGTH } = constants;
62294
-
62295
- exports = module.exports = {};
62296
-
62297
- // The actual regexps go on exports.re
62298
- const re = exports.re = [];
62299
- const src = exports.src = [];
62300
- const t = exports.t = {};
62301
- let R = 0;
62302
-
62303
- const createToken = (name, value, isGlobal) => {
62304
- const index = R++;
62305
- debug_1(index, value);
62306
- t[name] = index;
62307
- src[index] = value;
62308
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
62309
- };
62310
-
62311
- // The following Regular Expressions can be used for tokenizing,
62312
- // validating, and parsing SemVer version strings.
62313
-
62314
- // ## Numeric Identifier
62315
- // A single `0`, or a non-zero digit followed by zero or more digits.
62316
-
62317
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
62318
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
62319
-
62320
- // ## Non-numeric Identifier
62321
- // Zero or more digits, followed by a letter or hyphen, and then zero or
62322
- // more letters, digits, or hyphens.
62323
-
62324
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
62325
-
62326
- // ## Main Version
62327
- // Three dot-separated numeric identifiers.
62328
-
62329
- createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
62330
- `(${src[t.NUMERICIDENTIFIER]})\\.` +
62331
- `(${src[t.NUMERICIDENTIFIER]})`);
62332
-
62333
- createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
62334
- `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
62335
- `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
62336
-
62337
- // ## Pre-release Version Identifier
62338
- // A numeric identifier, or a non-numeric identifier.
62339
-
62340
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
62341
- }|${src[t.NONNUMERICIDENTIFIER]})`);
62342
-
62343
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
62344
- }|${src[t.NONNUMERICIDENTIFIER]})`);
62345
-
62346
- // ## Pre-release Version
62347
- // Hyphen, followed by one or more dot-separated pre-release version
62348
- // identifiers.
62349
-
62350
- createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
62351
- }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
62352
-
62353
- createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
62354
- }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
62355
-
62356
- // ## Build Metadata Identifier
62357
- // Any combination of digits, letters, or hyphens.
62358
-
62359
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
62360
-
62361
- // ## Build Metadata
62362
- // Plus sign, followed by one or more period-separated build metadata
62363
- // identifiers.
62364
-
62365
- createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
62366
- }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
62367
-
62368
- // ## Full Version String
62369
- // A main version, followed optionally by a pre-release version and
62370
- // build metadata.
62371
-
62372
- // Note that the only major, minor, patch, and pre-release sections of
62373
- // the version string are capturing groups. The build metadata is not a
62374
- // capturing group, because it should not ever be used in version
62375
- // comparison.
62376
-
62377
- createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
62378
- }${src[t.PRERELEASE]}?${
62379
- src[t.BUILD]}?`);
62380
-
62381
- createToken('FULL', `^${src[t.FULLPLAIN]}$`);
62382
-
62383
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
62384
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
62385
- // common in the npm registry.
62386
- createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
62387
- }${src[t.PRERELEASELOOSE]}?${
62388
- src[t.BUILD]}?`);
62389
-
62390
- createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
62391
-
62392
- createToken('GTLT', '((?:<|>)?=?)');
62393
-
62394
- // Something like "2.*" or "1.2.x".
62395
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
62396
- // Only the first item is strictly required.
62397
- createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
62398
- createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
62399
-
62400
- createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
62401
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
62402
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
62403
- `(?:${src[t.PRERELEASE]})?${
62404
- src[t.BUILD]}?` +
62405
- `)?)?`);
62406
62707
 
62407
- createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
62408
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
62409
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
62410
- `(?:${src[t.PRERELEASELOOSE]})?${
62411
- src[t.BUILD]}?` +
62412
- `)?)?`);
62708
+ path = [ ...getPropertyName(moddleElement, parent), ...path ];
62413
62709
 
62414
- createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
62415
- createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
62710
+ moddleElement = parent;
62416
62711
 
62417
- // Coercion.
62418
- // Extract anything that could conceivably be a part of a valid semver
62419
- createToken('COERCE', `${'(^|[^\\d])' +
62420
- '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
62421
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
62422
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
62423
- `(?:$|[^\\d])`);
62424
- createToken('COERCERTL', src[t.COERCE], true);
62425
-
62426
- // Tilde ranges.
62427
- // Meaning is "reasonably at or greater than"
62428
- createToken('LONETILDE', '(?:~>?)');
62429
-
62430
- createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
62431
- exports.tildeTrimReplace = '$1~';
62432
-
62433
- createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
62434
- createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
62435
-
62436
- // Caret ranges.
62437
- // Meaning is "at least and backwards compatible with"
62438
- createToken('LONECARET', '(?:\\^)');
62439
-
62440
- createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
62441
- exports.caretTrimReplace = '$1^';
62442
-
62443
- createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
62444
- createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
62445
-
62446
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
62447
- createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
62448
- createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
62449
-
62450
- // An expression to strip any whitespace between the gtlt and the thing
62451
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
62452
- createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
62453
- }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
62454
- exports.comparatorTrimReplace = '$1$2$3';
62455
-
62456
- // Something like `1.2.3 - 1.2.4`
62457
- // Note that these all use the loose form, because they'll be
62458
- // checked against either the strict or loose comparator form
62459
- // later.
62460
- createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
62461
- `\\s+-\\s+` +
62462
- `(${src[t.XRANGEPLAIN]})` +
62463
- `\\s*$`);
62464
-
62465
- createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
62466
- `\\s+-\\s+` +
62467
- `(${src[t.XRANGEPLAINLOOSE]})` +
62468
- `\\s*$`);
62469
-
62470
- // Star ranges basically just allow anything at all.
62471
- createToken('STAR', '(<|>)?=?\\s*\\*');
62472
- // >=0.0.0 is like a star
62473
- createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$');
62474
- createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$');
62475
- });
62476
-
62477
- // parse out just the options we care about so we always get a consistent
62478
- // obj with keys in a consistent order.
62479
- const opts = ['includePrerelease', 'loose', 'rtl'];
62480
- const parseOptions = options =>
62481
- !options ? {}
62482
- : typeof options !== 'object' ? { loose: true }
62483
- : opts.filter(k => options[k]).reduce((options, k) => {
62484
- options[k] = true;
62485
- return options
62486
- }, {});
62487
- var parseOptions_1 = parseOptions;
62488
-
62489
- const numeric = /^[0-9]+$/;
62490
- const compareIdentifiers = (a, b) => {
62491
- const anum = numeric.test(a);
62492
- const bnum = numeric.test(b);
62493
-
62494
- if (anum && bnum) {
62495
- a = +a;
62496
- b = +b;
62497
- }
62498
-
62499
- return a === b ? 0
62500
- : (anum && !bnum) ? -1
62501
- : (bnum && !anum) ? 1
62502
- : a < b ? -1
62503
- : 1
62504
- };
62505
-
62506
- const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
62712
+ if (parentModdleElement && moddleElement === parentModdleElement) {
62713
+ break;
62714
+ }
62715
+ } while (parent);
62507
62716
 
62508
- var identifiers = {
62509
- compareIdentifiers,
62510
- rcompareIdentifiers
62717
+ return path;
62511
62718
  };
62512
62719
 
62513
- const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1 } = constants;
62514
- const { re: re$2, t: t$2 } = re_1;
62515
-
62516
-
62517
- const { compareIdentifiers: compareIdentifiers$1 } = identifiers;
62518
- class SemVer {
62519
- constructor (version, options) {
62520
- options = parseOptions_1(options);
62521
-
62522
- if (version instanceof SemVer) {
62523
- if (version.loose === !!options.loose &&
62524
- version.includePrerelease === !!options.includePrerelease) {
62525
- return version
62526
- } else {
62527
- version = version.version;
62720
+ /**
62721
+ * Get property name from model element and parent model element.
62722
+ *
62723
+ * @param {ModdleElement} moddleElement
62724
+ * @param {ModdleElement} parentModdleElement
62725
+ *
62726
+ * @returns {string[]}
62727
+ */
62728
+ function getPropertyName(moddleElement, parentModdleElement) {
62729
+ for (let property of Object.values(parentModdleElement.$descriptor.propertiesByName)) {
62730
+ if (property.isMany) {
62731
+ if (parentModdleElement.get(property.name).includes(moddleElement)) {
62732
+ return [
62733
+ property.name,
62734
+ parentModdleElement.get(property.name).indexOf(moddleElement)
62735
+ ];
62528
62736
  }
62529
- } else if (typeof version !== 'string') {
62530
- throw new TypeError(`Invalid Version: ${version}`)
62531
- }
62532
-
62533
- if (version.length > MAX_LENGTH$1) {
62534
- throw new TypeError(
62535
- `version is longer than ${MAX_LENGTH$1} characters`
62536
- )
62537
- }
62538
-
62539
- debug_1('SemVer', version, options);
62540
- this.options = options;
62541
- this.loose = !!options.loose;
62542
- // this isn't actually relevant for versions, but keep it so that we
62543
- // don't run into trouble passing this.options around.
62544
- this.includePrerelease = !!options.includePrerelease;
62545
-
62546
- const m = version.trim().match(options.loose ? re$2[t$2.LOOSE] : re$2[t$2.FULL]);
62547
-
62548
- if (!m) {
62549
- throw new TypeError(`Invalid Version: ${version}`)
62550
- }
62551
-
62552
- this.raw = version;
62553
-
62554
- // these are actually numbers
62555
- this.major = +m[1];
62556
- this.minor = +m[2];
62557
- this.patch = +m[3];
62558
-
62559
- if (this.major > MAX_SAFE_INTEGER$1 || this.major < 0) {
62560
- throw new TypeError('Invalid major version')
62561
- }
62562
-
62563
- if (this.minor > MAX_SAFE_INTEGER$1 || this.minor < 0) {
62564
- throw new TypeError('Invalid minor version')
62565
- }
62566
-
62567
- if (this.patch > MAX_SAFE_INTEGER$1 || this.patch < 0) {
62568
- throw new TypeError('Invalid patch version')
62569
- }
62570
-
62571
- // numberify any prerelease numeric ids
62572
- if (!m[4]) {
62573
- this.prerelease = [];
62574
62737
  } else {
62575
- this.prerelease = m[4].split('.').map((id) => {
62576
- if (/^[0-9]+$/.test(id)) {
62577
- const num = +id;
62578
- if (num >= 0 && num < MAX_SAFE_INTEGER$1) {
62579
- return num
62580
- }
62581
- }
62582
- return id
62583
- });
62584
- }
62585
-
62586
- this.build = m[5] ? m[5].split('.') : [];
62587
- this.format();
62588
- }
62589
-
62590
- format () {
62591
- this.version = `${this.major}.${this.minor}.${this.patch}`;
62592
- if (this.prerelease.length) {
62593
- this.version += `-${this.prerelease.join('.')}`;
62594
- }
62595
- return this.version
62596
- }
62597
-
62598
- toString () {
62599
- return this.version
62600
- }
62601
-
62602
- compare (other) {
62603
- debug_1('SemVer.compare', this.version, this.options, other);
62604
- if (!(other instanceof SemVer)) {
62605
- if (typeof other === 'string' && other === this.version) {
62606
- return 0
62738
+ if (parentModdleElement.get(property.name) === moddleElement) {
62739
+ return [ property.name ];
62607
62740
  }
62608
- other = new SemVer(other, this.options);
62609
- }
62610
-
62611
- if (other.version === this.version) {
62612
- return 0
62613
62741
  }
62614
-
62615
- return this.compareMain(other) || this.comparePre(other)
62616
- }
62617
-
62618
- compareMain (other) {
62619
- if (!(other instanceof SemVer)) {
62620
- other = new SemVer(other, this.options);
62621
- }
62622
-
62623
- return (
62624
- compareIdentifiers$1(this.major, other.major) ||
62625
- compareIdentifiers$1(this.minor, other.minor) ||
62626
- compareIdentifiers$1(this.patch, other.patch)
62627
- )
62628
62742
  }
62629
62743
 
62630
- comparePre (other) {
62631
- if (!(other instanceof SemVer)) {
62632
- other = new SemVer(other, this.options);
62633
- }
62634
-
62635
- // NOT having a prerelease is > having one
62636
- if (this.prerelease.length && !other.prerelease.length) {
62637
- return -1
62638
- } else if (!this.prerelease.length && other.prerelease.length) {
62639
- return 1
62640
- } else if (!this.prerelease.length && !other.prerelease.length) {
62641
- return 0
62642
- }
62643
-
62644
- let i = 0;
62645
- do {
62646
- const a = this.prerelease[i];
62647
- const b = other.prerelease[i];
62648
- debug_1('prerelease compare', i, a, b);
62649
- if (a === undefined && b === undefined) {
62650
- return 0
62651
- } else if (b === undefined) {
62652
- return 1
62653
- } else if (a === undefined) {
62654
- return -1
62655
- } else if (a === b) {
62656
- continue
62657
- } else {
62658
- return compareIdentifiers$1(a, b)
62659
- }
62660
- } while (++i)
62661
- }
62662
-
62663
- compareBuild (other) {
62664
- if (!(other instanceof SemVer)) {
62665
- other = new SemVer(other, this.options);
62666
- }
62667
-
62668
- let i = 0;
62669
- do {
62670
- const a = this.build[i];
62671
- const b = other.build[i];
62672
- debug_1('prerelease compare', i, a, b);
62673
- if (a === undefined && b === undefined) {
62674
- return 0
62675
- } else if (b === undefined) {
62676
- return 1
62677
- } else if (a === undefined) {
62678
- return -1
62679
- } else if (a === b) {
62680
- continue
62681
- } else {
62682
- return compareIdentifiers$1(a, b)
62683
- }
62684
- } while (++i)
62685
- }
62686
-
62687
- // preminor will bump the version up to the next minor release, and immediately
62688
- // down to pre-release. premajor and prepatch work the same way.
62689
- inc (release, identifier) {
62690
- switch (release) {
62691
- case 'premajor':
62692
- this.prerelease.length = 0;
62693
- this.patch = 0;
62694
- this.minor = 0;
62695
- this.major++;
62696
- this.inc('pre', identifier);
62697
- break
62698
- case 'preminor':
62699
- this.prerelease.length = 0;
62700
- this.patch = 0;
62701
- this.minor++;
62702
- this.inc('pre', identifier);
62703
- break
62704
- case 'prepatch':
62705
- // If this is already a prerelease, it will bump to the next version
62706
- // drop any prereleases that might already exist, since they are not
62707
- // relevant at this point.
62708
- this.prerelease.length = 0;
62709
- this.inc('patch', identifier);
62710
- this.inc('pre', identifier);
62711
- break
62712
- // If the input is a non-prerelease version, this acts the same as
62713
- // prepatch.
62714
- case 'prerelease':
62715
- if (this.prerelease.length === 0) {
62716
- this.inc('patch', identifier);
62717
- }
62718
- this.inc('pre', identifier);
62719
- break
62720
-
62721
- case 'major':
62722
- // If this is a pre-major version, bump up to the same major version.
62723
- // Otherwise increment major.
62724
- // 1.0.0-5 bumps to 1.0.0
62725
- // 1.1.0 bumps to 2.0.0
62726
- if (
62727
- this.minor !== 0 ||
62728
- this.patch !== 0 ||
62729
- this.prerelease.length === 0
62730
- ) {
62731
- this.major++;
62732
- }
62733
- this.minor = 0;
62734
- this.patch = 0;
62735
- this.prerelease = [];
62736
- break
62737
- case 'minor':
62738
- // If this is a pre-minor version, bump up to the same minor version.
62739
- // Otherwise increment minor.
62740
- // 1.2.0-5 bumps to 1.2.0
62741
- // 1.2.1 bumps to 1.3.0
62742
- if (this.patch !== 0 || this.prerelease.length === 0) {
62743
- this.minor++;
62744
- }
62745
- this.patch = 0;
62746
- this.prerelease = [];
62747
- break
62748
- case 'patch':
62749
- // If this is not a pre-release version, it will increment the patch.
62750
- // If it is a pre-release it will bump up to the same patch version.
62751
- // 1.2.0-5 patches to 1.2.0
62752
- // 1.2.0 patches to 1.2.1
62753
- if (this.prerelease.length === 0) {
62754
- this.patch++;
62755
- }
62756
- this.prerelease = [];
62757
- break
62758
- // This probably shouldn't be used publicly.
62759
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
62760
- case 'pre':
62761
- if (this.prerelease.length === 0) {
62762
- this.prerelease = [0];
62763
- } else {
62764
- let i = this.prerelease.length;
62765
- while (--i >= 0) {
62766
- if (typeof this.prerelease[i] === 'number') {
62767
- this.prerelease[i]++;
62768
- i = -2;
62769
- }
62770
- }
62771
- if (i === -1) {
62772
- // didn't increment anything
62773
- this.prerelease.push(0);
62774
- }
62775
- }
62776
- if (identifier) {
62777
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
62778
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
62779
- if (this.prerelease[0] === identifier) {
62780
- if (isNaN(this.prerelease[1])) {
62781
- this.prerelease = [identifier, 0];
62782
- }
62783
- } else {
62784
- this.prerelease = [identifier, 0];
62785
- }
62786
- }
62787
- break
62788
-
62789
- default:
62790
- throw new Error(`invalid increment argument: ${release}`)
62791
- }
62792
- this.format();
62793
- this.raw = this.version;
62794
- return this
62795
- }
62744
+ return [];
62796
62745
  }
62797
62746
 
62798
- var semver = SemVer;
62799
-
62800
- const {MAX_LENGTH: MAX_LENGTH$2} = constants;
62801
- const { re: re$3, t: t$3 } = re_1;
62802
-
62803
-
62804
-
62805
- const parse$2 = (version, options) => {
62806
- options = parseOptions_1(options);
62807
-
62808
- if (version instanceof semver) {
62809
- return version
62810
- }
62811
-
62812
- if (typeof version !== 'string') {
62813
- return null
62814
- }
62815
-
62816
- if (version.length > MAX_LENGTH$2) {
62817
- return null
62818
- }
62819
-
62820
- const r = options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL];
62821
- if (!r.test(version)) {
62822
- return null
62823
- }
62824
-
62825
- try {
62826
- return new semver(version, options)
62827
- } catch (er) {
62828
- return null
62829
- }
62830
- };
62831
-
62832
- var parse_1 = parse$2;
62833
-
62834
- const valid = (version, options) => {
62835
- const v = parse_1(version, options);
62836
- return v ? v.version : null
62837
- };
62838
- var valid_1 = valid;
62839
-
62840
- const clean = (version, options) => {
62841
- const s = parse_1(version.trim().replace(/^[=v]+/, ''), options);
62842
- return s ? s.version : null
62843
- };
62844
- var clean_1 = clean;
62845
-
62846
- const inc = (version, release, options, identifier) => {
62847
- if (typeof (options) === 'string') {
62848
- identifier = options;
62849
- options = undefined;
62850
- }
62851
-
62852
- try {
62853
- return new semver(version, options).inc(release, identifier).version
62854
- } catch (er) {
62855
- return null
62856
- }
62857
- };
62858
- var inc_1 = inc;
62859
-
62860
- const compare = (a, b, loose) =>
62861
- new semver(a, loose).compare(new semver(b, loose));
62862
-
62863
- var compare_1 = compare;
62864
-
62865
- const eq = (a, b, loose) => compare_1(a, b, loose) === 0;
62866
- var eq_1 = eq;
62867
-
62868
- const diff = (version1, version2) => {
62869
- if (eq_1(version1, version2)) {
62870
- return null
62871
- } else {
62872
- const v1 = parse_1(version1);
62873
- const v2 = parse_1(version2);
62874
- const hasPre = v1.prerelease.length || v2.prerelease.length;
62875
- const prefix = hasPre ? 'pre' : '';
62876
- const defaultResult = hasPre ? 'prerelease' : '';
62877
- for (const key in v1) {
62878
- if (key === 'major' || key === 'minor' || key === 'patch') {
62879
- if (v1[key] !== v2[key]) {
62880
- return prefix + key
62881
- }
62882
- }
62883
- }
62884
- return defaultResult // may be undefined
62885
- }
62886
- };
62887
- var diff_1 = diff;
62888
-
62889
- const major = (a, loose) => new semver(a, loose).major;
62890
- var major_1 = major;
62891
-
62892
- const minor = (a, loose) => new semver(a, loose).minor;
62893
- var minor_1 = minor;
62894
-
62895
- const patch = (a, loose) => new semver(a, loose).patch;
62896
- var patch_1 = patch;
62897
-
62898
- const prerelease = (version, options) => {
62899
- const parsed = parse_1(version, options);
62900
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
62901
- };
62902
- var prerelease_1 = prerelease;
62903
-
62904
- const rcompare = (a, b, loose) => compare_1(b, a, loose);
62905
- var rcompare_1 = rcompare;
62906
-
62907
- const compareLoose = (a, b) => compare_1(a, b, true);
62908
- var compareLoose_1 = compareLoose;
62909
-
62910
- const compareBuild = (a, b, loose) => {
62911
- const versionA = new semver(a, loose);
62912
- const versionB = new semver(b, loose);
62913
- return versionA.compare(versionB) || versionA.compareBuild(versionB)
62914
- };
62915
- var compareBuild_1 = compareBuild;
62916
-
62917
- const sort = (list, loose) => list.sort((a, b) => compareBuild_1(a, b, loose));
62918
- var sort_1 = sort;
62919
-
62920
- const rsort = (list, loose) => list.sort((a, b) => compareBuild_1(b, a, loose));
62921
- var rsort_1 = rsort;
62922
-
62923
- const gt = (a, b, loose) => compare_1(a, b, loose) > 0;
62924
- var gt_1 = gt;
62925
-
62926
- const lt = (a, b, loose) => compare_1(a, b, loose) < 0;
62927
- var lt_1 = lt;
62928
-
62929
- const neq = (a, b, loose) => compare_1(a, b, loose) !== 0;
62930
- var neq_1 = neq;
62931
-
62932
- const gte = (a, b, loose) => compare_1(a, b, loose) >= 0;
62933
- var gte_1 = gte;
62934
-
62935
- const lte = (a, b, loose) => compare_1(a, b, loose) <= 0;
62936
- var lte_1 = lte;
62937
-
62938
- const cmp = (a, op, b, loose) => {
62939
- switch (op) {
62940
- case '===':
62941
- if (typeof a === 'object')
62942
- a = a.version;
62943
- if (typeof b === 'object')
62944
- b = b.version;
62945
- return a === b
62946
-
62947
- case '!==':
62948
- if (typeof a === 'object')
62949
- a = a.version;
62950
- if (typeof b === 'object')
62951
- b = b.version;
62952
- return a !== b
62953
-
62954
- case '':
62955
- case '=':
62956
- case '==':
62957
- return eq_1(a, b, loose)
62958
-
62959
- case '!=':
62960
- return neq_1(a, b, loose)
62961
-
62962
- case '>':
62963
- return gt_1(a, b, loose)
62964
-
62965
- case '>=':
62966
- return gte_1(a, b, loose)
62967
-
62968
- case '<':
62969
- return lt_1(a, b, loose)
62970
-
62971
- case '<=':
62972
- return lte_1(a, b, loose)
62973
-
62974
- default:
62975
- throw new TypeError(`Invalid operator: ${op}`)
62976
- }
62977
- };
62978
- var cmp_1 = cmp;
62979
-
62980
- const {re: re$4, t: t$4} = re_1;
62981
-
62982
- const coerce = (version, options) => {
62983
- if (version instanceof semver) {
62984
- return version
62985
- }
62986
-
62987
- if (typeof version === 'number') {
62988
- version = String(version);
62989
- }
62990
-
62991
- if (typeof version !== 'string') {
62992
- return null
62993
- }
62994
-
62995
- options = options || {};
62996
-
62997
- let match = null;
62998
- if (!options.rtl) {
62999
- match = version.match(re$4[t$4.COERCE]);
63000
- } else {
63001
- // Find the right-most coercible string that does not share
63002
- // a terminus with a more left-ward coercible string.
63003
- // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
63004
- //
63005
- // Walk through the string checking with a /g regexp
63006
- // Manually set the index so as to pick up overlapping matches.
63007
- // Stop when we get a match that ends at the string end, since no
63008
- // coercible string can be more right-ward without the same terminus.
63009
- let next;
63010
- while ((next = re$4[t$4.COERCERTL].exec(version)) &&
63011
- (!match || match.index + match[0].length !== version.length)
63012
- ) {
63013
- if (!match ||
63014
- next.index + next[0].length !== match.index + match[0].length) {
63015
- match = next;
63016
- }
63017
- re$4[t$4.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
63018
- }
63019
- // leave it in a clean state
63020
- re$4[t$4.COERCERTL].lastIndex = -1;
63021
- }
63022
-
63023
- if (match === null)
63024
- return null
63025
-
63026
- return parse_1(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
63027
- };
63028
- var coerce_1 = coerce;
62747
+ /**
62748
+ * @param {(string|(number|string)[])[]} paths
62749
+ *
62750
+ * @returns {(number|string)[]}
62751
+ */
62752
+ var pathConcat = function(...paths) {
62753
+ let concatenatedPaths = [];
63029
62754
 
63030
- var iterator = function (Yallist) {
63031
- Yallist.prototype[Symbol.iterator] = function* () {
63032
- for (let walker = this.head; walker; walker = walker.next) {
63033
- yield walker.value;
62755
+ for (let path of paths) {
62756
+ if (isNil$1(path) || isUndefined$2(path)) {
62757
+ return null;
63034
62758
  }
63035
- };
63036
- };
63037
62759
 
63038
- var yallist = Yallist;
63039
-
63040
- Yallist.Node = Node$1;
63041
- Yallist.create = Yallist;
63042
-
63043
- function Yallist (list) {
63044
- var self = this;
63045
- if (!(self instanceof Yallist)) {
63046
- self = new Yallist();
63047
- }
63048
-
63049
- self.tail = null;
63050
- self.head = null;
63051
- self.length = 0;
63052
-
63053
- if (list && typeof list.forEach === 'function') {
63054
- list.forEach(function (item) {
63055
- self.push(item);
63056
- });
63057
- } else if (arguments.length > 0) {
63058
- for (var i = 0, l = arguments.length; i < l; i++) {
63059
- self.push(arguments[i]);
62760
+ if (isString$1(path)) {
62761
+ path = [ path ];
63060
62762
  }
63061
- }
63062
-
63063
- return self
63064
- }
63065
-
63066
- Yallist.prototype.removeNode = function (node) {
63067
- if (node.list !== this) {
63068
- throw new Error('removing node which does not belong to this list')
63069
- }
63070
-
63071
- var next = node.next;
63072
- var prev = node.prev;
63073
-
63074
- if (next) {
63075
- next.prev = prev;
63076
- }
63077
-
63078
- if (prev) {
63079
- prev.next = next;
63080
- }
63081
-
63082
- if (node === this.head) {
63083
- this.head = next;
63084
- }
63085
- if (node === this.tail) {
63086
- this.tail = prev;
63087
- }
63088
-
63089
- node.list.length--;
63090
- node.next = null;
63091
- node.prev = null;
63092
- node.list = null;
63093
-
63094
- return next
63095
- };
63096
-
63097
- Yallist.prototype.unshiftNode = function (node) {
63098
- if (node === this.head) {
63099
- return
63100
- }
63101
-
63102
- if (node.list) {
63103
- node.list.removeNode(node);
63104
- }
63105
-
63106
- var head = this.head;
63107
- node.list = this;
63108
- node.next = head;
63109
- if (head) {
63110
- head.prev = node;
63111
- }
63112
-
63113
- this.head = node;
63114
- if (!this.tail) {
63115
- this.tail = node;
63116
- }
63117
- this.length++;
63118
- };
63119
-
63120
- Yallist.prototype.pushNode = function (node) {
63121
- if (node === this.tail) {
63122
- return
63123
- }
63124
-
63125
- if (node.list) {
63126
- node.list.removeNode(node);
63127
- }
63128
-
63129
- var tail = this.tail;
63130
- node.list = this;
63131
- node.prev = tail;
63132
- if (tail) {
63133
- tail.next = node;
63134
- }
63135
-
63136
- this.tail = node;
63137
- if (!this.head) {
63138
- this.head = node;
63139
- }
63140
- this.length++;
63141
- };
63142
-
63143
- Yallist.prototype.push = function () {
63144
- for (var i = 0, l = arguments.length; i < l; i++) {
63145
- push(this, arguments[i]);
63146
- }
63147
- return this.length
63148
- };
63149
-
63150
- Yallist.prototype.unshift = function () {
63151
- for (var i = 0, l = arguments.length; i < l; i++) {
63152
- unshift(this, arguments[i]);
63153
- }
63154
- return this.length
63155
- };
63156
-
63157
- Yallist.prototype.pop = function () {
63158
- if (!this.tail) {
63159
- return undefined
63160
- }
63161
-
63162
- var res = this.tail.value;
63163
- this.tail = this.tail.prev;
63164
- if (this.tail) {
63165
- this.tail.next = null;
63166
- } else {
63167
- this.head = null;
63168
- }
63169
- this.length--;
63170
- return res
63171
- };
63172
-
63173
- Yallist.prototype.shift = function () {
63174
- if (!this.head) {
63175
- return undefined
63176
- }
63177
-
63178
- var res = this.head.value;
63179
- this.head = this.head.next;
63180
- if (this.head) {
63181
- this.head.prev = null;
63182
- } else {
63183
- this.tail = null;
63184
- }
63185
- this.length--;
63186
- return res
63187
- };
63188
-
63189
- Yallist.prototype.forEach = function (fn, thisp) {
63190
- thisp = thisp || this;
63191
- for (var walker = this.head, i = 0; walker !== null; i++) {
63192
- fn.call(thisp, walker.value, i, this);
63193
- walker = walker.next;
63194
- }
63195
- };
63196
-
63197
- Yallist.prototype.forEachReverse = function (fn, thisp) {
63198
- thisp = thisp || this;
63199
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
63200
- fn.call(thisp, walker.value, i, this);
63201
- walker = walker.prev;
63202
- }
63203
- };
63204
-
63205
- Yallist.prototype.get = function (n) {
63206
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
63207
- // abort out of the list early if we hit a cycle
63208
- walker = walker.next;
63209
- }
63210
- if (i === n && walker !== null) {
63211
- return walker.value
63212
- }
63213
- };
63214
-
63215
- Yallist.prototype.getReverse = function (n) {
63216
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
63217
- // abort out of the list early if we hit a cycle
63218
- walker = walker.prev;
63219
- }
63220
- if (i === n && walker !== null) {
63221
- return walker.value
63222
- }
63223
- };
63224
-
63225
- Yallist.prototype.map = function (fn, thisp) {
63226
- thisp = thisp || this;
63227
- var res = new Yallist();
63228
- for (var walker = this.head; walker !== null;) {
63229
- res.push(fn.call(thisp, walker.value, this));
63230
- walker = walker.next;
63231
- }
63232
- return res
63233
- };
63234
-
63235
- Yallist.prototype.mapReverse = function (fn, thisp) {
63236
- thisp = thisp || this;
63237
- var res = new Yallist();
63238
- for (var walker = this.tail; walker !== null;) {
63239
- res.push(fn.call(thisp, walker.value, this));
63240
- walker = walker.prev;
63241
- }
63242
- return res
63243
- };
63244
-
63245
- Yallist.prototype.reduce = function (fn, initial) {
63246
- var acc;
63247
- var walker = this.head;
63248
- if (arguments.length > 1) {
63249
- acc = initial;
63250
- } else if (this.head) {
63251
- walker = this.head.next;
63252
- acc = this.head.value;
63253
- } else {
63254
- throw new TypeError('Reduce of empty list with no initial value')
63255
- }
63256
-
63257
- for (var i = 0; walker !== null; i++) {
63258
- acc = fn(acc, walker.value, i);
63259
- walker = walker.next;
63260
- }
63261
62763
 
63262
- return acc
63263
- };
63264
-
63265
- Yallist.prototype.reduceReverse = function (fn, initial) {
63266
- var acc;
63267
- var walker = this.tail;
63268
- if (arguments.length > 1) {
63269
- acc = initial;
63270
- } else if (this.tail) {
63271
- walker = this.tail.prev;
63272
- acc = this.tail.value;
63273
- } else {
63274
- throw new TypeError('Reduce of empty list with no initial value')
63275
- }
63276
-
63277
- for (var i = this.length - 1; walker !== null; i--) {
63278
- acc = fn(acc, walker.value, i);
63279
- walker = walker.prev;
63280
- }
63281
-
63282
- return acc
63283
- };
63284
-
63285
- Yallist.prototype.toArray = function () {
63286
- var arr = new Array(this.length);
63287
- for (var i = 0, walker = this.head; walker !== null; i++) {
63288
- arr[i] = walker.value;
63289
- walker = walker.next;
63290
- }
63291
- return arr
63292
- };
63293
-
63294
- Yallist.prototype.toArrayReverse = function () {
63295
- var arr = new Array(this.length);
63296
- for (var i = 0, walker = this.tail; walker !== null; i++) {
63297
- arr[i] = walker.value;
63298
- walker = walker.prev;
63299
- }
63300
- return arr
63301
- };
63302
-
63303
- Yallist.prototype.slice = function (from, to) {
63304
- to = to || this.length;
63305
- if (to < 0) {
63306
- to += this.length;
63307
- }
63308
- from = from || 0;
63309
- if (from < 0) {
63310
- from += this.length;
63311
- }
63312
- var ret = new Yallist();
63313
- if (to < from || to < 0) {
63314
- return ret
63315
- }
63316
- if (from < 0) {
63317
- from = 0;
63318
- }
63319
- if (to > this.length) {
63320
- to = this.length;
63321
- }
63322
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
63323
- walker = walker.next;
63324
- }
63325
- for (; walker !== null && i < to; i++, walker = walker.next) {
63326
- ret.push(walker.value);
62764
+ concatenatedPaths = concatenatedPaths.concat(path);
63327
62765
  }
63328
- return ret
63329
- };
63330
62766
 
63331
- Yallist.prototype.sliceReverse = function (from, to) {
63332
- to = to || this.length;
63333
- if (to < 0) {
63334
- to += this.length;
63335
- }
63336
- from = from || 0;
63337
- if (from < 0) {
63338
- from += this.length;
63339
- }
63340
- var ret = new Yallist();
63341
- if (to < from || to < 0) {
63342
- return ret
63343
- }
63344
- if (from < 0) {
63345
- from = 0;
63346
- }
63347
- if (to > this.length) {
63348
- to = this.length;
63349
- }
63350
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
63351
- walker = walker.prev;
63352
- }
63353
- for (; walker !== null && i > from; i--, walker = walker.prev) {
63354
- ret.push(walker.value);
63355
- }
63356
- return ret
62767
+ return concatenatedPaths;
63357
62768
  };
63358
62769
 
63359
- Yallist.prototype.splice = function (start, deleteCount, ...nodes) {
63360
- if (start > this.length) {
63361
- start = this.length - 1;
63362
- }
63363
- if (start < 0) {
63364
- start = this.length + start;
63365
- }
63366
-
63367
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
63368
- walker = walker.next;
63369
- }
63370
-
63371
- var ret = [];
63372
- for (var i = 0; walker && i < deleteCount; i++) {
63373
- ret.push(walker.value);
63374
- walker = this.removeNode(walker);
63375
- }
63376
- if (walker === null) {
63377
- walker = this.tail;
62770
+ /**
62771
+ * @param {string|(number|string)[]} a
62772
+ * @param {string|(number|string)[]} b
62773
+ * @param {string} [separator]
62774
+ *
62775
+ * @returns {boolean}
62776
+ */
62777
+ var pathEquals = function(a, b, separator = '.') {
62778
+ if (isNil$1(a) || isUndefined$2(a) || isNil$1(b) || isUndefined$2(b)) {
62779
+ return false;
63378
62780
  }
63379
62781
 
63380
- if (walker !== this.head && walker !== this.tail) {
63381
- walker = walker.prev;
62782
+ if (!isString$1(a)) {
62783
+ a = pathStringify(a, separator);
63382
62784
  }
63383
62785
 
63384
- for (var i = 0; i < nodes.length; i++) {
63385
- walker = insert(this, walker, nodes[i]);
62786
+ if (!isString$1(b)) {
62787
+ b = pathStringify(b, separator);
63386
62788
  }
63387
- return ret;
63388
- };
63389
62789
 
63390
- Yallist.prototype.reverse = function () {
63391
- var head = this.head;
63392
- var tail = this.tail;
63393
- for (var walker = head; walker !== null; walker = walker.prev) {
63394
- var p = walker.prev;
63395
- walker.prev = walker.next;
63396
- walker.next = p;
63397
- }
63398
- this.head = tail;
63399
- this.tail = head;
63400
- return this
62790
+ return a === b;
63401
62791
  };
63402
62792
 
63403
- function insert (self, node, value) {
63404
- var inserted = node === self.head ?
63405
- new Node$1(value, null, node, self) :
63406
- new Node$1(value, node, node.next, self);
63407
-
63408
- if (inserted.next === null) {
63409
- self.tail = inserted;
63410
- }
63411
- if (inserted.prev === null) {
63412
- self.head = inserted;
63413
- }
63414
-
63415
- self.length++;
63416
-
63417
- return inserted
63418
- }
63419
-
63420
- function push (self, item) {
63421
- self.tail = new Node$1(item, self.tail, null, self);
63422
- if (!self.head) {
63423
- self.head = self.tail;
63424
- }
63425
- self.length++;
63426
- }
63427
-
63428
- function unshift (self, item) {
63429
- self.head = new Node$1(item, null, self.head, self);
63430
- if (!self.tail) {
63431
- self.tail = self.head;
63432
- }
63433
- self.length++;
63434
- }
63435
-
63436
- function Node$1 (value, prev, next, list) {
63437
- if (!(this instanceof Node$1)) {
63438
- return new Node$1(value, prev, next, list)
63439
- }
63440
-
63441
- this.list = list;
63442
- this.value = value;
63443
-
63444
- if (prev) {
63445
- prev.next = this;
63446
- this.prev = prev;
63447
- } else {
63448
- this.prev = null;
62793
+ /**
62794
+ * @param {(number|string)[]} path
62795
+ * @param {string} [separator]
62796
+ *
62797
+ * @returns {string}
62798
+ */
62799
+ function pathStringify(path, separator = '.') {
62800
+ if (isNil$1(path) || isUndefined$2(path)) {
62801
+ return null;
63449
62802
  }
63450
62803
 
63451
- if (next) {
63452
- next.prev = this;
63453
- this.next = next;
63454
- } else {
63455
- this.next = null;
63456
- }
62804
+ return path.join(separator);
63457
62805
  }
63458
62806
 
63459
- try {
63460
- // add if support for Symbol.iterator is present
63461
- iterator(Yallist);
63462
- } catch (er) {}
63463
-
63464
- // A linked list to keep track of recently-used-ness
63465
-
63466
-
63467
- const MAX = Symbol('max');
63468
- const LENGTH = Symbol('length');
63469
- const LENGTH_CALCULATOR = Symbol('lengthCalculator');
63470
- const ALLOW_STALE = Symbol('allowStale');
63471
- const MAX_AGE = Symbol('maxAge');
63472
- const DISPOSE = Symbol('dispose');
63473
- const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
63474
- const LRU_LIST = Symbol('lruList');
63475
- const CACHE = Symbol('cache');
63476
- const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
63477
-
63478
- const naiveLength = () => 1;
63479
-
63480
- // lruList is a yallist where the head is the youngest
63481
- // item, and the tail is the oldest. the list contains the Hit
63482
- // objects as the entries.
63483
- // Each Hit object has a reference to its Yallist.Node. This
63484
- // never changes.
63485
- //
63486
- // cache is a Map (or PseudoMap) that matches the keys to
63487
- // the Yallist.Node object.
63488
- class LRUCache {
63489
- constructor (options) {
63490
- if (typeof options === 'number')
63491
- options = { max: options };
63492
-
63493
- if (!options)
63494
- options = {};
63495
-
63496
- if (options.max && (typeof options.max !== 'number' || options.max < 0))
63497
- throw new TypeError('max must be a non-negative number')
63498
- // Kind of weird to have a default max of Infinity, but oh well.
63499
- this[MAX] = options.max || Infinity;
63500
-
63501
- const lc = options.length || naiveLength;
63502
- this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
63503
- this[ALLOW_STALE] = options.stale || false;
63504
- if (options.maxAge && typeof options.maxAge !== 'number')
63505
- throw new TypeError('maxAge must be a number')
63506
- this[MAX_AGE] = options.maxAge || 0;
63507
- this[DISPOSE] = options.dispose;
63508
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
63509
- this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
63510
- this.reset();
63511
- }
63512
-
63513
- // resize the cache when the max changes.
63514
- set max (mL) {
63515
- if (typeof mL !== 'number' || mL < 0)
63516
- throw new TypeError('max must be a non-negative number')
63517
-
63518
- this[MAX] = mL || Infinity;
63519
- trim(this);
63520
- }
63521
- get max () {
63522
- return this[MAX]
63523
- }
63524
-
63525
- set allowStale (allowStale) {
63526
- this[ALLOW_STALE] = !!allowStale;
63527
- }
63528
- get allowStale () {
63529
- return this[ALLOW_STALE]
63530
- }
63531
-
63532
- set maxAge (mA) {
63533
- if (typeof mA !== 'number')
63534
- throw new TypeError('maxAge must be a non-negative number')
63535
-
63536
- this[MAX_AGE] = mA;
63537
- trim(this);
63538
- }
63539
- get maxAge () {
63540
- return this[MAX_AGE]
63541
- }
63542
-
63543
- // resize the cache when the lengthCalculator changes.
63544
- set lengthCalculator (lC) {
63545
- if (typeof lC !== 'function')
63546
- lC = naiveLength;
63547
-
63548
- if (lC !== this[LENGTH_CALCULATOR]) {
63549
- this[LENGTH_CALCULATOR] = lC;
63550
- this[LENGTH] = 0;
63551
- this[LRU_LIST].forEach(hit => {
63552
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
63553
- this[LENGTH] += hit.length;
63554
- });
63555
- }
63556
- trim(this);
63557
- }
63558
- get lengthCalculator () { return this[LENGTH_CALCULATOR] }
63559
-
63560
- get length () { return this[LENGTH] }
63561
- get itemCount () { return this[LRU_LIST].length }
63562
-
63563
- rforEach (fn, thisp) {
63564
- thisp = thisp || this;
63565
- for (let walker = this[LRU_LIST].tail; walker !== null;) {
63566
- const prev = walker.prev;
63567
- forEachStep(this, fn, walker, thisp);
63568
- walker = prev;
63569
- }
63570
- }
63571
-
63572
- forEach (fn, thisp) {
63573
- thisp = thisp || this;
63574
- for (let walker = this[LRU_LIST].head; walker !== null;) {
63575
- const next = walker.next;
63576
- forEachStep(this, fn, walker, thisp);
63577
- walker = next;
63578
- }
63579
- }
63580
-
63581
- keys () {
63582
- return this[LRU_LIST].toArray().map(k => k.key)
63583
- }
63584
-
63585
- values () {
63586
- return this[LRU_LIST].toArray().map(k => k.value)
63587
- }
63588
-
63589
- reset () {
63590
- if (this[DISPOSE] &&
63591
- this[LRU_LIST] &&
63592
- this[LRU_LIST].length) {
63593
- this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
63594
- }
63595
-
63596
- this[CACHE] = new Map(); // hash of items by key
63597
- this[LRU_LIST] = new yallist(); // list of items in order of use recency
63598
- this[LENGTH] = 0; // length of items in the list
63599
- }
63600
-
63601
- dump () {
63602
- return this[LRU_LIST].map(hit =>
63603
- isStale(this, hit) ? false : {
63604
- k: hit.key,
63605
- v: hit.value,
63606
- e: hit.now + (hit.maxAge || 0)
63607
- }).toArray().filter(h => h)
63608
- }
63609
-
63610
- dumpLru () {
63611
- return this[LRU_LIST]
63612
- }
63613
-
63614
- set (key, value, maxAge) {
63615
- maxAge = maxAge || this[MAX_AGE];
63616
-
63617
- if (maxAge && typeof maxAge !== 'number')
63618
- throw new TypeError('maxAge must be a number')
63619
-
63620
- const now = maxAge ? Date.now() : 0;
63621
- const len = this[LENGTH_CALCULATOR](value, key);
63622
-
63623
- if (this[CACHE].has(key)) {
63624
- if (len > this[MAX]) {
63625
- del(this, this[CACHE].get(key));
63626
- return false
63627
- }
63628
-
63629
- const node = this[CACHE].get(key);
63630
- const item = node.value;
63631
-
63632
- // dispose of the old one before overwriting
63633
- // split out into 2 ifs for better coverage tracking
63634
- if (this[DISPOSE]) {
63635
- if (!this[NO_DISPOSE_ON_SET])
63636
- this[DISPOSE](key, item.value);
63637
- }
63638
-
63639
- item.now = now;
63640
- item.maxAge = maxAge;
63641
- item.value = value;
63642
- this[LENGTH] += len - item.length;
63643
- item.length = len;
63644
- this.get(key);
63645
- trim(this);
63646
- return true
63647
- }
63648
-
63649
- const hit = new Entry(key, value, len, now, maxAge);
63650
-
63651
- // oversized objects fall out of cache automatically.
63652
- if (hit.length > this[MAX]) {
63653
- if (this[DISPOSE])
63654
- this[DISPOSE](key, value);
63655
-
63656
- return false
63657
- }
63658
-
63659
- this[LENGTH] += hit.length;
63660
- this[LRU_LIST].unshift(hit);
63661
- this[CACHE].set(key, this[LRU_LIST].head);
63662
- trim(this);
63663
- return true
63664
- }
63665
-
63666
- has (key) {
63667
- if (!this[CACHE].has(key)) return false
63668
- const hit = this[CACHE].get(key).value;
63669
- return !isStale(this, hit)
63670
- }
63671
-
63672
- get (key) {
63673
- return get$3(this, key, true)
63674
- }
63675
-
63676
- peek (key) {
63677
- return get$3(this, key, false)
63678
- }
62807
+ /**
62808
+ * Failsafe remove an element from a collection
62809
+ *
62810
+ * @param {Array<Object>} [collection]
62811
+ * @param {Object} [element]
62812
+ *
62813
+ * @return {number} the previous index of the element
62814
+ */
63679
62815
 
63680
- pop () {
63681
- const node = this[LRU_LIST].tail;
63682
- if (!node)
63683
- return null
62816
+ /**
62817
+ * Fail save add an element to the given connection, ensuring
62818
+ * it does not yet exist.
62819
+ *
62820
+ * @param {Array<Object>} collection
62821
+ * @param {Object} element
62822
+ * @param {number} idx
62823
+ */
62824
+ function add$2(collection, element, idx) {
63684
62825
 
63685
- del(this, node);
63686
- return node.value
62826
+ if (!collection || !element) {
62827
+ return;
63687
62828
  }
63688
62829
 
63689
- del (key) {
63690
- del(this, this[CACHE].get(key));
62830
+ if (typeof idx !== 'number') {
62831
+ idx = -1;
63691
62832
  }
63692
62833
 
63693
- load (arr) {
63694
- // reset the cache
63695
- this.reset();
62834
+ var currentIdx = collection.indexOf(element);
63696
62835
 
63697
- const now = Date.now();
63698
- // A previous serialized cache has the most recent items first
63699
- for (let l = arr.length - 1; l >= 0; l--) {
63700
- const hit = arr[l];
63701
- const expiresAt = hit.e || 0;
63702
- if (expiresAt === 0)
63703
- // the item was created without expiration in a non aged cache
63704
- this.set(hit.k, hit.v);
63705
- else {
63706
- const maxAge = expiresAt - now;
63707
- // dont add already expired items
63708
- if (maxAge > 0) {
63709
- this.set(hit.k, hit.v, maxAge);
63710
- }
63711
- }
63712
- }
63713
- }
62836
+ if (currentIdx !== -1) {
63714
62837
 
63715
- prune () {
63716
- this[CACHE].forEach((value, key) => get$3(this, key, false));
63717
- }
63718
- }
62838
+ if (currentIdx === idx) {
63719
62839
 
63720
- const get$3 = (self, key, doUse) => {
63721
- const node = self[CACHE].get(key);
63722
- if (node) {
63723
- const hit = node.value;
63724
- if (isStale(self, hit)) {
63725
- del(self, node);
63726
- if (!self[ALLOW_STALE])
63727
- return undefined
62840
+ // nothing to do, position has not changed
62841
+ return;
63728
62842
  } else {
63729
- if (doUse) {
63730
- if (self[UPDATE_AGE_ON_GET])
63731
- node.value.now = Date.now();
63732
- self[LRU_LIST].unshiftNode(node);
63733
- }
63734
- }
63735
- return hit.value
63736
- }
63737
- };
63738
-
63739
- const isStale = (self, hit) => {
63740
- if (!hit || (!hit.maxAge && !self[MAX_AGE]))
63741
- return false
63742
-
63743
- const diff = Date.now() - hit.now;
63744
- return hit.maxAge ? diff > hit.maxAge
63745
- : self[MAX_AGE] && (diff > self[MAX_AGE])
63746
- };
63747
-
63748
- const trim = self => {
63749
- if (self[LENGTH] > self[MAX]) {
63750
- for (let walker = self[LRU_LIST].tail;
63751
- self[LENGTH] > self[MAX] && walker !== null;) {
63752
- // We know that we're about to delete this one, and also
63753
- // what the next least recently used key will be, so just
63754
- // go ahead and set it now.
63755
- const prev = walker.prev;
63756
- del(self, walker);
63757
- walker = prev;
63758
- }
63759
- }
63760
- };
63761
-
63762
- const del = (self, node) => {
63763
- if (node) {
63764
- const hit = node.value;
63765
- if (self[DISPOSE])
63766
- self[DISPOSE](hit.key, hit.value);
63767
62843
 
63768
- self[LENGTH] -= hit.length;
63769
- self[CACHE].delete(hit.key);
63770
- self[LRU_LIST].removeNode(node);
63771
- }
63772
- };
63773
-
63774
- class Entry {
63775
- constructor (key, value, length, now, maxAge) {
63776
- this.key = key;
63777
- this.value = value;
63778
- this.length = length;
63779
- this.now = now;
63780
- this.maxAge = maxAge || 0;
63781
- }
63782
- }
63783
-
63784
- const forEachStep = (self, fn, node, thisp) => {
63785
- let hit = node.value;
63786
- if (isStale(self, hit)) {
63787
- del(self, node);
63788
- if (!self[ALLOW_STALE])
63789
- hit = undefined;
63790
- }
63791
- if (hit)
63792
- fn.call(thisp, hit.value, hit.key, self);
63793
- };
63794
-
63795
- var lruCache = LRUCache;
63796
-
63797
- // hoisted class for cyclic dependency
63798
- class Range {
63799
- constructor (range, options) {
63800
- options = parseOptions_1(options);
62844
+ if (idx !== -1) {
63801
62845
 
63802
- if (range instanceof Range) {
63803
- if (
63804
- range.loose === !!options.loose &&
63805
- range.includePrerelease === !!options.includePrerelease
63806
- ) {
63807
- return range
62846
+ // remove from current position
62847
+ collection.splice(currentIdx, 1);
63808
62848
  } else {
63809
- return new Range(range.raw, options)
63810
- }
63811
- }
63812
-
63813
- if (range instanceof comparator) {
63814
- // just put it in the set and return
63815
- this.raw = range.value;
63816
- this.set = [[range]];
63817
- this.format();
63818
- return this
63819
- }
63820
-
63821
- this.options = options;
63822
- this.loose = !!options.loose;
63823
- this.includePrerelease = !!options.includePrerelease;
63824
-
63825
- // First, split based on boolean or ||
63826
- this.raw = range;
63827
- this.set = range
63828
- .split(/\s*\|\|\s*/)
63829
- // map the range to a 2d array of comparators
63830
- .map(range => this.parseRange(range.trim()))
63831
- // throw out any comparator lists that are empty
63832
- // this generally means that it was not a valid range, which is allowed
63833
- // in loose mode, but will still throw if the WHOLE range is invalid.
63834
- .filter(c => c.length);
63835
-
63836
- if (!this.set.length) {
63837
- throw new TypeError(`Invalid SemVer Range: ${range}`)
63838
- }
63839
-
63840
- // if we have any that are not the null set, throw out null sets.
63841
- if (this.set.length > 1) {
63842
- // keep the first one, in case they're all null sets
63843
- const first = this.set[0];
63844
- this.set = this.set.filter(c => !isNullSet(c[0]));
63845
- if (this.set.length === 0)
63846
- this.set = [first];
63847
- else if (this.set.length > 1) {
63848
- // if we have any that are *, then the range is just *
63849
- for (const c of this.set) {
63850
- if (c.length === 1 && isAny$1(c[0])) {
63851
- this.set = [c];
63852
- break
63853
- }
63854
- }
63855
- }
63856
- }
63857
-
63858
- this.format();
63859
- }
63860
-
63861
- format () {
63862
- this.range = this.set
63863
- .map((comps) => {
63864
- return comps.join(' ').trim()
63865
- })
63866
- .join('||')
63867
- .trim();
63868
- return this.range
63869
- }
63870
-
63871
- toString () {
63872
- return this.range
63873
- }
63874
-
63875
- parseRange (range) {
63876
- range = range.trim();
63877
-
63878
- // memoize range parsing for performance.
63879
- // this is a very hot path, and fully deterministic.
63880
- const memoOpts = Object.keys(this.options).join(',');
63881
- const memoKey = `parseRange:${memoOpts}:${range}`;
63882
- const cached = cache.get(memoKey);
63883
- if (cached)
63884
- return cached
63885
-
63886
- const loose = this.options.loose;
63887
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
63888
- const hr = loose ? re$5[t$5.HYPHENRANGELOOSE] : re$5[t$5.HYPHENRANGE];
63889
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
63890
- debug_1('hyphen replace', range);
63891
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
63892
- range = range.replace(re$5[t$5.COMPARATORTRIM], comparatorTrimReplace);
63893
- debug_1('comparator trim', range, re$5[t$5.COMPARATORTRIM]);
63894
-
63895
- // `~ 1.2.3` => `~1.2.3`
63896
- range = range.replace(re$5[t$5.TILDETRIM], tildeTrimReplace);
63897
-
63898
- // `^ 1.2.3` => `^1.2.3`
63899
- range = range.replace(re$5[t$5.CARETTRIM], caretTrimReplace);
63900
-
63901
- // normalize spaces
63902
- range = range.split(/\s+/).join(' ');
63903
-
63904
- // At this point, the range is completely trimmed and
63905
- // ready to be split into comparators.
63906
-
63907
- const compRe = loose ? re$5[t$5.COMPARATORLOOSE] : re$5[t$5.COMPARATOR];
63908
- const rangeList = range
63909
- .split(' ')
63910
- .map(comp => parseComparator(comp, this.options))
63911
- .join(' ')
63912
- .split(/\s+/)
63913
- // >=0.0.0 is equivalent to *
63914
- .map(comp => replaceGTE0(comp, this.options))
63915
- // in loose mode, throw out any that are not valid comparators
63916
- .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)
63917
- .map(comp => new comparator(comp, this.options));
63918
-
63919
- // if any comparators are the null set, then replace with JUST null set
63920
- // if more than one comparator, remove any * comparators
63921
- // also, don't include the same comparator more than once
63922
- rangeList.length;
63923
- const rangeMap = new Map();
63924
- for (const comp of rangeList) {
63925
- if (isNullSet(comp))
63926
- return [comp]
63927
- rangeMap.set(comp.value, comp);
63928
- }
63929
- if (rangeMap.size > 1 && rangeMap.has(''))
63930
- rangeMap.delete('');
63931
-
63932
- const result = [...rangeMap.values()];
63933
- cache.set(memoKey, result);
63934
- return result
63935
- }
63936
-
63937
- intersects (range, options) {
63938
- if (!(range instanceof Range)) {
63939
- throw new TypeError('a Range is required')
63940
- }
63941
-
63942
- return this.set.some((thisComparators) => {
63943
- return (
63944
- isSatisfiable(thisComparators, options) &&
63945
- range.set.some((rangeComparators) => {
63946
- return (
63947
- isSatisfiable(rangeComparators, options) &&
63948
- thisComparators.every((thisComparator) => {
63949
- return rangeComparators.every((rangeComparator) => {
63950
- return thisComparator.intersects(rangeComparator, options)
63951
- })
63952
- })
63953
- )
63954
- })
63955
- )
63956
- })
63957
- }
63958
-
63959
- // if ANY of the sets match ALL of its comparators, then pass
63960
- test (version) {
63961
- if (!version) {
63962
- return false
63963
- }
63964
-
63965
- if (typeof version === 'string') {
63966
- try {
63967
- version = new semver(version, this.options);
63968
- } catch (er) {
63969
- return false
63970
- }
63971
- }
63972
62849
 
63973
- for (let i = 0; i < this.set.length; i++) {
63974
- if (testSet(this.set[i], version, this.options)) {
63975
- return true
62850
+ // already exists in collection
62851
+ return;
63976
62852
  }
63977
62853
  }
63978
- return false
63979
62854
  }
63980
- }
63981
- var range = Range;
63982
-
63983
-
63984
- const cache = new lruCache({ max: 1000 });
63985
-
63986
-
63987
-
63988
-
63989
-
63990
- const {
63991
- re: re$5,
63992
- t: t$5,
63993
- comparatorTrimReplace,
63994
- tildeTrimReplace,
63995
- caretTrimReplace
63996
- } = re_1;
63997
-
63998
- const isNullSet = c => c.value === '<0.0.0-0';
63999
- const isAny$1 = c => c.value === '';
64000
-
64001
- // take a set of comparators and determine whether there
64002
- // exists a version which can satisfy it
64003
- const isSatisfiable = (comparators, options) => {
64004
- let result = true;
64005
- const remainingComparators = comparators.slice();
64006
- let testComparator = remainingComparators.pop();
64007
-
64008
- while (result && remainingComparators.length) {
64009
- result = remainingComparators.every((otherComparator) => {
64010
- return testComparator.intersects(otherComparator, options)
64011
- });
64012
-
64013
- testComparator = remainingComparators.pop();
64014
- }
64015
-
64016
- return result
64017
- };
64018
-
64019
- // comprised of xranges, tildes, stars, and gtlt's at this point.
64020
- // already replaced the hyphen ranges
64021
- // turn into a set of JUST comparators.
64022
- const parseComparator = (comp, options) => {
64023
- debug_1('comp', comp, options);
64024
- comp = replaceCarets(comp, options);
64025
- debug_1('caret', comp);
64026
- comp = replaceTildes(comp, options);
64027
- debug_1('tildes', comp);
64028
- comp = replaceXRanges(comp, options);
64029
- debug_1('xrange', comp);
64030
- comp = replaceStars(comp, options);
64031
- debug_1('stars', comp);
64032
- return comp
64033
- };
64034
-
64035
- const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
64036
-
64037
- // ~, ~> --> * (any, kinda silly)
64038
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
64039
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
64040
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
64041
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
64042
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
64043
- const replaceTildes = (comp, options) =>
64044
- comp.trim().split(/\s+/).map((comp) => {
64045
- return replaceTilde(comp, options)
64046
- }).join(' ');
64047
-
64048
- const replaceTilde = (comp, options) => {
64049
- const r = options.loose ? re$5[t$5.TILDELOOSE] : re$5[t$5.TILDE];
64050
- return comp.replace(r, (_, M, m, p, pr) => {
64051
- debug_1('tilde', comp, _, M, m, p, pr);
64052
- let ret;
64053
-
64054
- if (isX(M)) {
64055
- ret = '';
64056
- } else if (isX(m)) {
64057
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
64058
- } else if (isX(p)) {
64059
- // ~1.2 == >=1.2.0 <1.3.0-0
64060
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
64061
- } else if (pr) {
64062
- debug_1('replaceTilde pr', pr);
64063
- ret = `>=${M}.${m}.${p}-${pr
64064
- } <${M}.${+m + 1}.0-0`;
64065
- } else {
64066
- // ~1.2.3 == >=1.2.3 <1.3.0-0
64067
- ret = `>=${M}.${m}.${p
64068
- } <${M}.${+m + 1}.0-0`;
64069
- }
64070
-
64071
- debug_1('tilde return', ret);
64072
- return ret
64073
- })
64074
- };
64075
-
64076
- // ^ --> * (any, kinda silly)
64077
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
64078
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
64079
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
64080
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
64081
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
64082
- const replaceCarets = (comp, options) =>
64083
- comp.trim().split(/\s+/).map((comp) => {
64084
- return replaceCaret(comp, options)
64085
- }).join(' ');
64086
-
64087
- const replaceCaret = (comp, options) => {
64088
- debug_1('caret', comp, options);
64089
- const r = options.loose ? re$5[t$5.CARETLOOSE] : re$5[t$5.CARET];
64090
- const z = options.includePrerelease ? '-0' : '';
64091
- return comp.replace(r, (_, M, m, p, pr) => {
64092
- debug_1('caret', comp, _, M, m, p, pr);
64093
- let ret;
64094
-
64095
- if (isX(M)) {
64096
- ret = '';
64097
- } else if (isX(m)) {
64098
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
64099
- } else if (isX(p)) {
64100
- if (M === '0') {
64101
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
64102
- } else {
64103
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
64104
- }
64105
- } else if (pr) {
64106
- debug_1('replaceCaret pr', pr);
64107
- if (M === '0') {
64108
- if (m === '0') {
64109
- ret = `>=${M}.${m}.${p}-${pr
64110
- } <${M}.${m}.${+p + 1}-0`;
64111
- } else {
64112
- ret = `>=${M}.${m}.${p}-${pr
64113
- } <${M}.${+m + 1}.0-0`;
64114
- }
64115
- } else {
64116
- ret = `>=${M}.${m}.${p}-${pr
64117
- } <${+M + 1}.0.0-0`;
64118
- }
64119
- } else {
64120
- debug_1('no pr');
64121
- if (M === '0') {
64122
- if (m === '0') {
64123
- ret = `>=${M}.${m}.${p
64124
- }${z} <${M}.${m}.${+p + 1}-0`;
64125
- } else {
64126
- ret = `>=${M}.${m}.${p
64127
- }${z} <${M}.${+m + 1}.0-0`;
64128
- }
64129
- } else {
64130
- ret = `>=${M}.${m}.${p
64131
- } <${+M + 1}.0.0-0`;
64132
- }
64133
- }
64134
-
64135
- debug_1('caret return', ret);
64136
- return ret
64137
- })
64138
- };
64139
-
64140
- const replaceXRanges = (comp, options) => {
64141
- debug_1('replaceXRanges', comp, options);
64142
- return comp.split(/\s+/).map((comp) => {
64143
- return replaceXRange(comp, options)
64144
- }).join(' ')
64145
- };
64146
-
64147
- const replaceXRange = (comp, options) => {
64148
- comp = comp.trim();
64149
- const r = options.loose ? re$5[t$5.XRANGELOOSE] : re$5[t$5.XRANGE];
64150
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
64151
- debug_1('xRange', comp, ret, gtlt, M, m, p, pr);
64152
- const xM = isX(M);
64153
- const xm = xM || isX(m);
64154
- const xp = xm || isX(p);
64155
- const anyX = xp;
64156
-
64157
- if (gtlt === '=' && anyX) {
64158
- gtlt = '';
64159
- }
64160
62855
 
64161
- // if we're including prereleases in the match, then we need
64162
- // to fix this to -0, the lowest possible prerelease value
64163
- pr = options.includePrerelease ? '-0' : '';
64164
-
64165
- if (xM) {
64166
- if (gtlt === '>' || gtlt === '<') {
64167
- // nothing is allowed
64168
- ret = '<0.0.0-0';
64169
- } else {
64170
- // nothing is forbidden
64171
- ret = '*';
64172
- }
64173
- } else if (gtlt && anyX) {
64174
- // we know patch is an x, because we have any x at all.
64175
- // replace X with 0
64176
- if (xm) {
64177
- m = 0;
64178
- }
64179
- p = 0;
64180
-
64181
- if (gtlt === '>') {
64182
- // >1 => >=2.0.0
64183
- // >1.2 => >=1.3.0
64184
- gtlt = '>=';
64185
- if (xm) {
64186
- M = +M + 1;
64187
- m = 0;
64188
- p = 0;
64189
- } else {
64190
- m = +m + 1;
64191
- p = 0;
64192
- }
64193
- } else if (gtlt === '<=') {
64194
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
64195
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
64196
- gtlt = '<';
64197
- if (xm) {
64198
- M = +M + 1;
64199
- } else {
64200
- m = +m + 1;
64201
- }
64202
- }
62856
+ if (idx !== -1) {
64203
62857
 
64204
- if (gtlt === '<')
64205
- pr = '-0';
64206
-
64207
- ret = `${gtlt + M}.${m}.${p}${pr}`;
64208
- } else if (xm) {
64209
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
64210
- } else if (xp) {
64211
- ret = `>=${M}.${m}.0${pr
64212
- } <${M}.${+m + 1}.0-0`;
64213
- }
64214
-
64215
- debug_1('xRange return', ret);
64216
-
64217
- return ret
64218
- })
64219
- };
64220
-
64221
- // Because * is AND-ed with everything else in the comparator,
64222
- // and '' means "any version", just remove the *s entirely.
64223
- const replaceStars = (comp, options) => {
64224
- debug_1('replaceStars', comp, options);
64225
- // Looseness is ignored here. star is always as loose as it gets!
64226
- return comp.trim().replace(re$5[t$5.STAR], '')
64227
- };
64228
-
64229
- const replaceGTE0 = (comp, options) => {
64230
- debug_1('replaceGTE0', comp, options);
64231
- return comp.trim()
64232
- .replace(re$5[options.includePrerelease ? t$5.GTE0PRE : t$5.GTE0], '')
64233
- };
64234
-
64235
- // This function is passed to string.replace(re[t.HYPHENRANGE])
64236
- // M, m, patch, prerelease, build
64237
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
64238
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
64239
- // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
64240
- const hyphenReplace = incPr => ($0,
64241
- from, fM, fm, fp, fpr, fb,
64242
- to, tM, tm, tp, tpr, tb) => {
64243
- if (isX(fM)) {
64244
- from = '';
64245
- } else if (isX(fm)) {
64246
- from = `>=${fM}.0.0${incPr ? '-0' : ''}`;
64247
- } else if (isX(fp)) {
64248
- from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;
64249
- } else if (fpr) {
64250
- from = `>=${from}`;
64251
- } else {
64252
- from = `>=${from}${incPr ? '-0' : ''}`;
64253
- }
64254
-
64255
- if (isX(tM)) {
64256
- to = '';
64257
- } else if (isX(tm)) {
64258
- to = `<${+tM + 1}.0.0-0`;
64259
- } else if (isX(tp)) {
64260
- to = `<${tM}.${+tm + 1}.0-0`;
64261
- } else if (tpr) {
64262
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
64263
- } else if (incPr) {
64264
- to = `<${tM}.${tm}.${+tp + 1}-0`;
62858
+ // insert at specified position
62859
+ collection.splice(idx, 0, element);
64265
62860
  } else {
64266
- to = `<=${to}`;
64267
- }
64268
-
64269
- return (`${from} ${to}`).trim()
64270
- };
64271
-
64272
- const testSet = (set, version, options) => {
64273
- for (let i = 0; i < set.length; i++) {
64274
- if (!set[i].test(version)) {
64275
- return false
64276
- }
64277
- }
64278
-
64279
- if (version.prerelease.length && !options.includePrerelease) {
64280
- // Find the set of versions that are allowed to have prereleases
64281
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
64282
- // That should allow `1.2.3-pr.2` to pass.
64283
- // However, `1.2.4-alpha.notready` should NOT be allowed,
64284
- // even though it's within the range set by the comparators.
64285
- for (let i = 0; i < set.length; i++) {
64286
- debug_1(set[i].semver);
64287
- if (set[i].semver === comparator.ANY) {
64288
- continue
64289
- }
64290
-
64291
- if (set[i].semver.prerelease.length > 0) {
64292
- const allowed = set[i].semver;
64293
- if (allowed.major === version.major &&
64294
- allowed.minor === version.minor &&
64295
- allowed.patch === version.patch) {
64296
- return true
64297
- }
64298
- }
64299
- }
64300
-
64301
- // Version has a -pre, but it's not one of the ones we like.
64302
- return false
64303
- }
64304
-
64305
- return true
64306
- };
64307
-
64308
- const ANY = Symbol('SemVer ANY');
64309
- // hoisted class for cyclic dependency
64310
- class Comparator {
64311
- static get ANY () {
64312
- return ANY
64313
- }
64314
- constructor (comp, options) {
64315
- options = parseOptions_1(options);
64316
-
64317
- if (comp instanceof Comparator) {
64318
- if (comp.loose === !!options.loose) {
64319
- return comp
64320
- } else {
64321
- comp = comp.value;
64322
- }
64323
- }
64324
-
64325
- debug_1('comparator', comp, options);
64326
- this.options = options;
64327
- this.loose = !!options.loose;
64328
- this.parse(comp);
64329
-
64330
- if (this.semver === ANY) {
64331
- this.value = '';
64332
- } else {
64333
- this.value = this.operator + this.semver.version;
64334
- }
64335
-
64336
- debug_1('comp', this);
64337
- }
64338
-
64339
- parse (comp) {
64340
- const r = this.options.loose ? re$6[t$6.COMPARATORLOOSE] : re$6[t$6.COMPARATOR];
64341
- const m = comp.match(r);
64342
-
64343
- if (!m) {
64344
- throw new TypeError(`Invalid comparator: ${comp}`)
64345
- }
64346
-
64347
- this.operator = m[1] !== undefined ? m[1] : '';
64348
- if (this.operator === '=') {
64349
- this.operator = '';
64350
- }
64351
-
64352
- // if it literally is just '>' or '' then allow anything.
64353
- if (!m[2]) {
64354
- this.semver = ANY;
64355
- } else {
64356
- this.semver = new semver(m[2], this.options.loose);
64357
- }
64358
- }
64359
-
64360
- toString () {
64361
- return this.value
64362
- }
64363
-
64364
- test (version) {
64365
- debug_1('Comparator.test', version, this.options.loose);
64366
-
64367
- if (this.semver === ANY || version === ANY) {
64368
- return true
64369
- }
64370
-
64371
- if (typeof version === 'string') {
64372
- try {
64373
- version = new semver(version, this.options);
64374
- } catch (er) {
64375
- return false
64376
- }
64377
- }
64378
-
64379
- return cmp_1(version, this.operator, this.semver, this.options)
64380
- }
64381
-
64382
- intersects (comp, options) {
64383
- if (!(comp instanceof Comparator)) {
64384
- throw new TypeError('a Comparator is required')
64385
- }
64386
-
64387
- if (!options || typeof options !== 'object') {
64388
- options = {
64389
- loose: !!options,
64390
- includePrerelease: false
64391
- };
64392
- }
64393
62861
 
64394
- if (this.operator === '') {
64395
- if (this.value === '') {
64396
- return true
64397
- }
64398
- return new range(comp.value, options).test(this.value)
64399
- } else if (comp.operator === '') {
64400
- if (comp.value === '') {
64401
- return true
64402
- }
64403
- return new range(this.value, options).test(comp.semver)
64404
- }
64405
-
64406
- const sameDirectionIncreasing =
64407
- (this.operator === '>=' || this.operator === '>') &&
64408
- (comp.operator === '>=' || comp.operator === '>');
64409
- const sameDirectionDecreasing =
64410
- (this.operator === '<=' || this.operator === '<') &&
64411
- (comp.operator === '<=' || comp.operator === '<');
64412
- const sameSemVer = this.semver.version === comp.semver.version;
64413
- const differentDirectionsInclusive =
64414
- (this.operator === '>=' || this.operator === '<=') &&
64415
- (comp.operator === '>=' || comp.operator === '<=');
64416
- const oppositeDirectionsLessThan =
64417
- cmp_1(this.semver, '<', comp.semver, options) &&
64418
- (this.operator === '>=' || this.operator === '>') &&
64419
- (comp.operator === '<=' || comp.operator === '<');
64420
- const oppositeDirectionsGreaterThan =
64421
- cmp_1(this.semver, '>', comp.semver, options) &&
64422
- (this.operator === '<=' || this.operator === '<') &&
64423
- (comp.operator === '>=' || comp.operator === '>');
64424
-
64425
- return (
64426
- sameDirectionIncreasing ||
64427
- sameDirectionDecreasing ||
64428
- (sameSemVer && differentDirectionsInclusive) ||
64429
- oppositeDirectionsLessThan ||
64430
- oppositeDirectionsGreaterThan
64431
- )
62862
+ // push to end
62863
+ collection.push(element);
64432
62864
  }
64433
62865
  }
64434
62866
 
64435
- var comparator = Comparator;
64436
-
64437
-
64438
- const {re: re$6, t: t$6} = re_1;
64439
-
64440
- const satisfies = (version, range$1, options) => {
64441
- try {
64442
- range$1 = new range(range$1, options);
64443
- } catch (er) {
64444
- return false
64445
- }
64446
- return range$1.test(version)
64447
- };
64448
- var satisfies_1 = satisfies;
64449
-
64450
- // Mostly just for testing and legacy API reasons
64451
- const toComparators = (range$1, options) =>
64452
- new range(range$1, options).set
64453
- .map(comp => comp.map(c => c.value).join(' ').trim().split(' '));
64454
-
64455
- var toComparators_1 = toComparators;
64456
-
64457
- const maxSatisfying = (versions, range$1, options) => {
64458
- let max = null;
64459
- let maxSV = null;
64460
- let rangeObj = null;
64461
- try {
64462
- rangeObj = new range(range$1, options);
64463
- } catch (er) {
64464
- return null
64465
- }
64466
- versions.forEach((v) => {
64467
- if (rangeObj.test(v)) {
64468
- // satisfies(v, range, options)
64469
- if (!max || maxSV.compare(v) === -1) {
64470
- // compare(max, v, true)
64471
- max = v;
64472
- maxSV = new semver(max, options);
64473
- }
64474
- }
64475
- });
64476
- return max
64477
- };
64478
- var maxSatisfying_1 = maxSatisfying;
64479
-
64480
- const minSatisfying = (versions, range$1, options) => {
64481
- let min = null;
64482
- let minSV = null;
64483
- let rangeObj = null;
64484
- try {
64485
- rangeObj = new range(range$1, options);
64486
- } catch (er) {
64487
- return null
64488
- }
64489
- versions.forEach((v) => {
64490
- if (rangeObj.test(v)) {
64491
- // satisfies(v, range, options)
64492
- if (!min || minSV.compare(v) === 1) {
64493
- // compare(min, v, true)
64494
- min = v;
64495
- minSV = new semver(min, options);
64496
- }
64497
- }
64498
- });
64499
- return min
64500
- };
64501
- var minSatisfying_1 = minSatisfying;
64502
-
64503
- const minVersion = (range$1, loose) => {
64504
- range$1 = new range(range$1, loose);
64505
-
64506
- let minver = new semver('0.0.0');
64507
- if (range$1.test(minver)) {
64508
- return minver
64509
- }
64510
-
64511
- minver = new semver('0.0.0-0');
64512
- if (range$1.test(minver)) {
64513
- return minver
64514
- }
64515
-
64516
- minver = null;
64517
- for (let i = 0; i < range$1.set.length; ++i) {
64518
- const comparators = range$1.set[i];
64519
-
64520
- let setMin = null;
64521
- comparators.forEach((comparator) => {
64522
- // Clone to avoid manipulating the comparator's semver object.
64523
- const compver = new semver(comparator.semver.version);
64524
- switch (comparator.operator) {
64525
- case '>':
64526
- if (compver.prerelease.length === 0) {
64527
- compver.patch++;
64528
- } else {
64529
- compver.prerelease.push(0);
64530
- }
64531
- compver.raw = compver.format();
64532
- /* fallthrough */
64533
- case '':
64534
- case '>=':
64535
- if (!setMin || gt_1(compver, setMin)) {
64536
- setMin = compver;
64537
- }
64538
- break
64539
- case '<':
64540
- case '<=':
64541
- /* Ignore maximum versions */
64542
- break
64543
- /* istanbul ignore next */
64544
- default:
64545
- throw new Error(`Unexpected operation: ${comparator.operator}`)
64546
- }
64547
- });
64548
- if (setMin && (!minver || gt_1(minver, setMin)))
64549
- minver = setMin;
64550
- }
64551
-
64552
- if (minver && range$1.test(minver)) {
64553
- return minver
64554
- }
64555
-
64556
- return null
64557
- };
64558
- var minVersion_1 = minVersion;
64559
-
64560
- const validRange = (range$1, options) => {
64561
- try {
64562
- // Return '*' instead of '' so that truthiness works.
64563
- // This will throw if it's invalid anyway
64564
- return new range(range$1, options).range || '*'
64565
- } catch (er) {
64566
- return null
64567
- }
64568
- };
64569
- var valid$1 = validRange;
64570
-
64571
- const {ANY: ANY$1} = comparator;
64572
-
64573
-
64574
-
64575
-
64576
-
64577
-
64578
-
64579
- const outside = (version, range$1, hilo, options) => {
64580
- version = new semver(version, options);
64581
- range$1 = new range(range$1, options);
64582
-
64583
- let gtfn, ltefn, ltfn, comp, ecomp;
64584
- switch (hilo) {
64585
- case '>':
64586
- gtfn = gt_1;
64587
- ltefn = lte_1;
64588
- ltfn = lt_1;
64589
- comp = '>';
64590
- ecomp = '>=';
64591
- break
64592
- case '<':
64593
- gtfn = lt_1;
64594
- ltefn = gte_1;
64595
- ltfn = gt_1;
64596
- comp = '<';
64597
- ecomp = '<=';
64598
- break
64599
- default:
64600
- throw new TypeError('Must provide a hilo val of "<" or ">"')
64601
- }
62867
+ const BpmnPropertiesPanelContext = q({
62868
+ selectedElement: null,
62869
+ injector: null,
64602
62870
 
64603
- // If it satisfies the range it is not outside
64604
- if (satisfies_1(version, range$1, options)) {
64605
- return false
62871
+ getService() {
62872
+ return null;
64606
62873
  }
64607
62874
 
64608
- // From now on, variable terms are as if we're in "gtr" mode.
64609
- // but note that everything is flipped for the "ltr" function.
62875
+ });
64610
62876
 
64611
- for (let i = 0; i < range$1.set.length; ++i) {
64612
- const comparators = range$1.set[i];
62877
+ function useService(type, strict) {
62878
+ const {
62879
+ getService
62880
+ } = F(BpmnPropertiesPanelContext);
62881
+ return getService(type, strict);
62882
+ }
64613
62883
 
64614
- let high = null;
64615
- let low = null;
62884
+ /**
62885
+ * Returns a memoized callback to be passed as `show` prop. Callback returns
62886
+ * true if (1) ID and path match or (2) ID matches and matcher returns true.
62887
+ *
62888
+ * @example
62889
+ *
62890
+ * // using path
62891
+ * const show = useShowCallback(businessObject, [ 'foo' ]);
62892
+ *
62893
+ * @example
62894
+ *
62895
+ * // using matcher
62896
+ * const show = useShowCallback(businessObject, (event) => event.foo === 'bar');
62897
+ *
62898
+ * @param {Object} businessObject
62899
+ * @param {string[]|Function} matcher
62900
+ *
62901
+ * @returns {Function}
62902
+ */
64616
62903
 
64617
- comparators.forEach((comparator$1) => {
64618
- if (comparator$1.semver === ANY$1) {
64619
- comparator$1 = new comparator('>=0.0.0');
64620
- }
64621
- high = high || comparator$1;
64622
- low = low || comparator$1;
64623
- if (gtfn(comparator$1.semver, high.semver, options)) {
64624
- high = comparator$1;
64625
- } else if (ltfn(comparator$1.semver, low.semver, options)) {
64626
- low = comparator$1;
64627
- }
64628
- });
62904
+ function useShowCallback(businessObject, matcher) {
62905
+ return A$1(event => {
62906
+ const {
62907
+ id,
62908
+ path
62909
+ } = event;
64629
62910
 
64630
- // If the edge version comparator has a operator then our version
64631
- // isn't outside it
64632
- if (high.operator === comp || high.operator === ecomp) {
64633
- return false
62911
+ if (id !== businessObject.get('id')) {
62912
+ return false;
64634
62913
  }
64635
62914
 
64636
- // If the lowest version comparator has an operator and our version
64637
- // is less than it then it isn't higher than the range
64638
- if ((!low.operator || low.operator === comp) &&
64639
- ltefn(version, low.semver)) {
64640
- return false
64641
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
64642
- return false
62915
+ if (isArray(matcher)) {
62916
+ return path && pathEquals(path, matcher);
64643
62917
  }
64644
- }
64645
- return true
64646
- };
64647
-
64648
- var outside_1 = outside;
64649
62918
 
64650
- // Determine if version is greater than all the versions possible in the range.
64651
-
64652
- const gtr = (version, range, options) => outside_1(version, range, '>', options);
64653
- var gtr_1 = gtr;
64654
-
64655
- // Determine if version is less than all the versions possible in the range
64656
- const ltr = (version, range, options) => outside_1(version, range, '<', options);
64657
- var ltr_1 = ltr;
64658
-
64659
- const intersects = (r1, r2, options) => {
64660
- r1 = new range(r1, options);
64661
- r2 = new range(r2, options);
64662
- return r1.intersects(r2)
64663
- };
64664
- var intersects_1 = intersects;
64665
-
64666
- // given a set of versions and a range, create a "simplified" range
64667
- // that includes the same versions that the original range does
64668
- // If the original range is shorter than the simplified one, return that.
64669
-
64670
-
64671
- var simplify = (versions, range, options) => {
64672
- const set = [];
64673
- let min = null;
64674
- let prev = null;
64675
- const v = versions.sort((a, b) => compare_1(a, b, options));
64676
- for (const version of v) {
64677
- const included = satisfies_1(version, range, options);
64678
- if (included) {
64679
- prev = version;
64680
- if (!min)
64681
- min = version;
64682
- } else {
64683
- if (prev) {
64684
- set.push([min, prev]);
64685
- }
64686
- prev = null;
64687
- min = null;
62919
+ if (isFunction(matcher)) {
62920
+ return !!matcher(event);
64688
62921
  }
64689
- }
64690
- if (min)
64691
- set.push([min, null]);
64692
-
64693
- const ranges = [];
64694
- for (const [min, max] of set) {
64695
- if (min === max)
64696
- ranges.push(min);
64697
- else if (!max && min === v[0])
64698
- ranges.push('*');
64699
- else if (!max)
64700
- ranges.push(`>=${min}`);
64701
- else if (min === v[0])
64702
- ranges.push(`<=${max}`);
64703
- else
64704
- ranges.push(`${min} - ${max}`);
64705
- }
64706
- const simplified = ranges.join(' || ');
64707
- const original = typeof range.raw === 'string' ? range.raw : String(range);
64708
- return simplified.length < original.length ? simplified : range
64709
- };
64710
-
64711
- const { ANY: ANY$2 } = comparator;
64712
62922
 
64713
-
64714
-
64715
- // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
64716
- // - Every simple range `r1, r2, ...` is a null set, OR
64717
- // - Every simple range `r1, r2, ...` which is not a null set is a subset of
64718
- // some `R1, R2, ...`
64719
- //
64720
- // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
64721
- // - If c is only the ANY comparator
64722
- // - If C is only the ANY comparator, return true
64723
- // - Else if in prerelease mode, return false
64724
- // - else replace c with `[>=0.0.0]`
64725
- // - If C is only the ANY comparator
64726
- // - if in prerelease mode, return true
64727
- // - else replace C with `[>=0.0.0]`
64728
- // - Let EQ be the set of = comparators in c
64729
- // - If EQ is more than one, return true (null set)
64730
- // - Let GT be the highest > or >= comparator in c
64731
- // - Let LT be the lowest < or <= comparator in c
64732
- // - If GT and LT, and GT.semver > LT.semver, return true (null set)
64733
- // - If any C is a = range, and GT or LT are set, return false
64734
- // - If EQ
64735
- // - If GT, and EQ does not satisfy GT, return true (null set)
64736
- // - If LT, and EQ does not satisfy LT, return true (null set)
64737
- // - If EQ satisfies every C, return true
64738
- // - Else return false
64739
- // - If GT
64740
- // - If GT.semver is lower than any > or >= comp in C, return false
64741
- // - If GT is >=, and GT.semver does not satisfy every C, return false
64742
- // - If GT.semver has a prerelease, and not in prerelease mode
64743
- // - If no C has a prerelease and the GT.semver tuple, return false
64744
- // - If LT
64745
- // - If LT.semver is greater than any < or <= comp in C, return false
64746
- // - If LT is <=, and LT.semver does not satisfy every C, return false
64747
- // - If GT.semver has a prerelease, and not in prerelease mode
64748
- // - If no C has a prerelease and the LT.semver tuple, return false
64749
- // - Else return true
64750
-
64751
- const subset = (sub, dom, options = {}) => {
64752
- if (sub === dom)
64753
- return true
64754
-
64755
- sub = new range(sub, options);
64756
- dom = new range(dom, options);
64757
- let sawNonNull = false;
64758
-
64759
- OUTER: for (const simpleSub of sub.set) {
64760
- for (const simpleDom of dom.set) {
64761
- const isSub = simpleSubset(simpleSub, simpleDom, options);
64762
- sawNonNull = sawNonNull || isSub !== null;
64763
- if (isSub)
64764
- continue OUTER
64765
- }
64766
- // the null set is a subset of everything, but null simple ranges in
64767
- // a complex range should be ignored. so if we saw a non-null range,
64768
- // then we know this isn't a subset, but if EVERY simple range was null,
64769
- // then it is a subset.
64770
- if (sawNonNull)
64771
- return false
64772
- }
64773
- return true
64774
- };
64775
-
64776
- const simpleSubset = (sub, dom, options) => {
64777
- if (sub === dom)
64778
- return true
64779
-
64780
- if (sub.length === 1 && sub[0].semver === ANY$2) {
64781
- if (dom.length === 1 && dom[0].semver === ANY$2)
64782
- return true
64783
- else if (options.includePrerelease)
64784
- sub = [ new comparator('>=0.0.0-0') ];
64785
- else
64786
- sub = [ new comparator('>=0.0.0') ];
64787
- }
64788
-
64789
- if (dom.length === 1 && dom[0].semver === ANY$2) {
64790
- if (options.includePrerelease)
64791
- return true
64792
- else
64793
- dom = [ new comparator('>=0.0.0') ];
64794
- }
64795
-
64796
- const eqSet = new Set();
64797
- let gt, lt;
64798
- for (const c of sub) {
64799
- if (c.operator === '>' || c.operator === '>=')
64800
- gt = higherGT(gt, c, options);
64801
- else if (c.operator === '<' || c.operator === '<=')
64802
- lt = lowerLT(lt, c, options);
64803
- else
64804
- eqSet.add(c.semver);
64805
- }
64806
-
64807
- if (eqSet.size > 1)
64808
- return null
64809
-
64810
- let gtltComp;
64811
- if (gt && lt) {
64812
- gtltComp = compare_1(gt.semver, lt.semver, options);
64813
- if (gtltComp > 0)
64814
- return null
64815
- else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))
64816
- return null
64817
- }
64818
-
64819
- // will iterate one or zero times
64820
- for (const eq of eqSet) {
64821
- if (gt && !satisfies_1(eq, String(gt), options))
64822
- return null
64823
-
64824
- if (lt && !satisfies_1(eq, String(lt), options))
64825
- return null
64826
-
64827
- for (const c of dom) {
64828
- if (!satisfies_1(eq, String(c), options))
64829
- return false
64830
- }
64831
-
64832
- return true
64833
- }
64834
-
64835
- let higher, lower;
64836
- let hasDomLT, hasDomGT;
64837
- // if the subset has a prerelease, we need a comparator in the superset
64838
- // with the same tuple and a prerelease, or it's not a subset
64839
- let needDomLTPre = lt &&
64840
- !options.includePrerelease &&
64841
- lt.semver.prerelease.length ? lt.semver : false;
64842
- let needDomGTPre = gt &&
64843
- !options.includePrerelease &&
64844
- gt.semver.prerelease.length ? gt.semver : false;
64845
- // exception: <1.2.3-0 is the same as <1.2.3
64846
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
64847
- lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
64848
- needDomLTPre = false;
64849
- }
64850
-
64851
- for (const c of dom) {
64852
- hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=';
64853
- hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=';
64854
- if (gt) {
64855
- if (needDomGTPre) {
64856
- if (c.semver.prerelease && c.semver.prerelease.length &&
64857
- c.semver.major === needDomGTPre.major &&
64858
- c.semver.minor === needDomGTPre.minor &&
64859
- c.semver.patch === needDomGTPre.patch) {
64860
- needDomGTPre = false;
64861
- }
64862
- }
64863
- if (c.operator === '>' || c.operator === '>=') {
64864
- higher = higherGT(gt, c, options);
64865
- if (higher === c && higher !== gt)
64866
- return false
64867
- } else if (gt.operator === '>=' && !satisfies_1(gt.semver, String(c), options))
64868
- return false
64869
- }
64870
- if (lt) {
64871
- if (needDomLTPre) {
64872
- if (c.semver.prerelease && c.semver.prerelease.length &&
64873
- c.semver.major === needDomLTPre.major &&
64874
- c.semver.minor === needDomLTPre.minor &&
64875
- c.semver.patch === needDomLTPre.patch) {
64876
- needDomLTPre = false;
64877
- }
64878
- }
64879
- if (c.operator === '<' || c.operator === '<=') {
64880
- lower = lowerLT(lt, c, options);
64881
- if (lower === c && lower !== lt)
64882
- return false
64883
- } else if (lt.operator === '<=' && !satisfies_1(lt.semver, String(c), options))
64884
- return false
64885
- }
64886
- if (!c.operator && (lt || gt) && gtltComp !== 0)
64887
- return false
64888
- }
64889
-
64890
- // if there was a < or >, and nothing in the dom, then must be false
64891
- // UNLESS it was limited by another range in the other direction.
64892
- // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
64893
- if (gt && hasDomLT && !lt && gtltComp !== 0)
64894
- return false
64895
-
64896
- if (lt && hasDomGT && !gt && gtltComp !== 0)
64897
- return false
64898
-
64899
- // we needed a prerelease range in a specific tuple, but didn't get one
64900
- // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
64901
- // because it includes prereleases in the 1.2.3 tuple
64902
- if (needDomGTPre || needDomLTPre)
64903
- return false
64904
-
64905
- return true
64906
- };
64907
-
64908
- // >=1.2.3 is lower than >1.2.3
64909
- const higherGT = (a, b, options) => {
64910
- if (!a)
64911
- return b
64912
- const comp = compare_1(a.semver, b.semver, options);
64913
- return comp > 0 ? a
64914
- : comp < 0 ? b
64915
- : b.operator === '>' && a.operator === '>=' ? b
64916
- : a
64917
- };
64918
-
64919
- // <=1.2.3 is higher than <1.2.3
64920
- const lowerLT = (a, b, options) => {
64921
- if (!a)
64922
- return b
64923
- const comp = compare_1(a.semver, b.semver, options);
64924
- return comp < 0 ? a
64925
- : comp > 0 ? b
64926
- : b.operator === '<' && a.operator === '<=' ? b
64927
- : a
64928
- };
64929
-
64930
- var subset_1 = subset;
64931
-
64932
- // just pre-load all the stuff that index.js lazily exports
64933
-
64934
- ({
64935
- re: re_1.re,
64936
- src: re_1.src,
64937
- tokens: re_1.t,
64938
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
64939
- SemVer: semver,
64940
- compareIdentifiers: identifiers.compareIdentifiers,
64941
- rcompareIdentifiers: identifiers.rcompareIdentifiers,
64942
- parse: parse_1,
64943
- valid: valid_1,
64944
- clean: clean_1,
64945
- inc: inc_1,
64946
- diff: diff_1,
64947
- major: major_1,
64948
- minor: minor_1,
64949
- patch: patch_1,
64950
- prerelease: prerelease_1,
64951
- compare: compare_1,
64952
- rcompare: rcompare_1,
64953
- compareLoose: compareLoose_1,
64954
- compareBuild: compareBuild_1,
64955
- sort: sort_1,
64956
- rsort: rsort_1,
64957
- gt: gt_1,
64958
- lt: lt_1,
64959
- eq: eq_1,
64960
- neq: neq_1,
64961
- gte: gte_1,
64962
- lte: lte_1,
64963
- cmp: cmp_1,
64964
- coerce: coerce_1,
64965
- Comparator: comparator,
64966
- Range: range,
64967
- satisfies: satisfies_1,
64968
- toComparators: toComparators_1,
64969
- maxSatisfying: maxSatisfying_1,
64970
- minSatisfying: minSatisfying_1,
64971
- minVersion: minVersion_1,
64972
- validRange: valid$1,
64973
- outside: outside_1,
64974
- gtr: gtr_1,
64975
- ltr: ltr_1,
64976
- intersects: intersects_1,
64977
- simplifyRange: simplify,
64978
- subset: subset_1,
64979
- });
64980
-
64981
- const BpmnPropertiesPanelContext = q({
64982
- selectedElement: null,
64983
- injector: null,
64984
-
64985
- getService() {
64986
- return null;
64987
- }
64988
-
64989
- });
62923
+ return false;
62924
+ }, [businessObject, matcher]);
62925
+ }
64990
62926
 
64991
62927
  function _extends$1m() { _extends$1m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1m.apply(this, arguments); }
64992
62928
  var AssociationIcon = (({
@@ -66207,6 +64143,14 @@
66207
64143
  return type;
66208
64144
  }
66209
64145
  const PanelHeaderProvider = {
64146
+ getDocumentationRef: element => {
64147
+ // eslint-disable-next-line react-hooks/rules-of-hooks
64148
+ const elementTemplates = useService('elementTemplates', false);
64149
+
64150
+ if (elementTemplates) {
64151
+ return getTemplateDocumentation(element, elementTemplates);
64152
+ }
64153
+ },
66210
64154
  getElementLabel: element => {
66211
64155
  if (is$1(element, 'bpmn:Process')) {
66212
64156
  return getBusinessObject(element).name;
@@ -66219,6 +64163,17 @@
66219
64163
  return iconsByType[concreteType];
66220
64164
  },
66221
64165
  getTypeLabel: element => {
64166
+ // eslint-disable-next-line react-hooks/rules-of-hooks
64167
+ const elementTemplates = useService('elementTemplates', false);
64168
+
64169
+ if (elementTemplates) {
64170
+ const template = getTemplate(element, elementTemplates);
64171
+
64172
+ if (template && template.name) {
64173
+ return template.name;
64174
+ }
64175
+ }
64176
+
66222
64177
  const concreteType = getConcreteType(element);
66223
64178
  return concreteType.replace(/(\B[A-Z])/g, ' $1').replace(/(\bNon Interrupting)/g, '($1)');
66224
64179
  }
@@ -66264,8 +64219,7 @@
66264
64219
  }
66265
64220
 
66266
64221
  return businessObject.conditionExpression && is$1(sourceBusinessObject, 'bpmn:Activity');
66267
- } // helpers //////////
66268
-
64222
+ }
66269
64223
 
66270
64224
  function isPlane$1(element) {
66271
64225
  // Backwards compatibility for bpmn-js<8
@@ -66273,6 +64227,17 @@
66273
64227
  return is$1(di, 'bpmndi:BPMNPlane');
66274
64228
  }
66275
64229
 
64230
+ function getTemplate(element, elementTemplates) {
64231
+ const templateId = elementTemplates._getTemplateId(element);
64232
+
64233
+ return templateId && elementTemplates.get(templateId);
64234
+ }
64235
+
64236
+ function getTemplateDocumentation(element, elementTemplates) {
64237
+ const template = getTemplate(element, elementTemplates);
64238
+ return template && template.documentationRef;
64239
+ }
64240
+
66276
64241
  function BpmnPropertiesPanel(props) {
66277
64242
  const {
66278
64243
  element,
@@ -66420,7 +64385,8 @@
66420
64385
  layoutConfig: layoutConfig,
66421
64386
  layoutChanged: onLayoutChanged,
66422
64387
  descriptionConfig: descriptionConfig,
66423
- descriptionLoaded: onDescriptionLoaded
64388
+ descriptionLoaded: onDescriptionLoaded,
64389
+ eventBus: eventBus
66424
64390
  })
66425
64391
  });
66426
64392
  } // helpers //////////////////////////
@@ -66438,7 +64404,7 @@
66438
64404
  return element && elementRegistry.get(element.id);
66439
64405
  }
66440
64406
 
66441
- const DEFAULT_PRIORITY$6 = 1000;
64407
+ const DEFAULT_PRIORITY$7 = 1000;
66442
64408
  /**
66443
64409
  * @typedef { import('@bpmn-io/properties-panel').GroupDefinition } GroupDefinition
66444
64410
  * @typedef { import('@bpmn-io/properties-panel').ListGroupDefinition } ListGroupDefinition
@@ -66521,7 +64487,7 @@
66521
64487
  registerProvider(priority, provider) {
66522
64488
  if (!provider) {
66523
64489
  provider = priority;
66524
- priority = DEFAULT_PRIORITY$6;
64490
+ priority = DEFAULT_PRIORITY$7;
66525
64491
  }
66526
64492
 
66527
64493
  if (typeof provider.getGroups !== 'function') {
@@ -66633,13 +64599,6 @@
66633
64599
  propertiesPanel: ['type', BpmnPropertiesPanelRenderer]
66634
64600
  };
66635
64601
 
66636
- function useService (type, strict) {
66637
- const {
66638
- getService
66639
- } = F(BpmnPropertiesPanelContext);
66640
- return getService(type, strict);
66641
- }
66642
-
66643
64602
  function ReferenceSelectEntry(props) {
66644
64603
  const {
66645
64604
  autoFocusEntry,
@@ -66859,7 +64818,7 @@
66859
64818
  label: translate('<none>')
66860
64819
  }];
66861
64820
  const activities = findActivityRefs(element);
66862
- sortByName$7(activities).forEach(function (activity) {
64821
+ sortByName$6(activities).forEach(function (activity) {
66863
64822
  options.push({
66864
64823
  value: activity.id,
66865
64824
  label: createOptionLabel(activity)
@@ -66982,7 +64941,7 @@
66982
64941
  return `${name ? name + ' ' : ''}(id=${id})`;
66983
64942
  }
66984
64943
 
66985
- function sortByName$7(elements) {
64944
+ function sortByName$6(elements) {
66986
64945
  return sortBy(elements, e => (e.name || '').toLowerCase());
66987
64946
  }
66988
64947
 
@@ -67286,7 +65245,7 @@
67286
65245
  label: translate('Create new ...')
67287
65246
  }];
67288
65247
  const errors = findRootElementsByType(getBusinessObject(element), 'bpmn:Error');
67289
- sortByName$6(errors).forEach(error => {
65248
+ sortByName$5(errors).forEach(error => {
67290
65249
  options.push({
67291
65250
  value: error.get('id'),
67292
65251
  label: error.get('name')
@@ -67295,6 +65254,9 @@
67295
65254
  return options;
67296
65255
  };
67297
65256
 
65257
+ const businessObject = getBusinessObject(element),
65258
+ path = pathConcat(getPath(errorEventDefinition, businessObject), 'errorRef');
65259
+ const show = useShowCallback(businessObject, path);
67298
65260
  return ReferenceSelectEntry({
67299
65261
  element,
67300
65262
  id: 'errorRef',
@@ -67302,7 +65264,8 @@
67302
65264
  autoFocusEntry: 'errorName',
67303
65265
  getValue,
67304
65266
  setValue,
67305
- getOptions
65267
+ getOptions,
65268
+ show
67306
65269
  });
67307
65270
  }
67308
65271
 
@@ -67373,7 +65336,7 @@
67373
65336
  } // helper /////////////////////////
67374
65337
 
67375
65338
 
67376
- function sortByName$6(elements) {
65339
+ function sortByName$5(elements) {
67377
65340
  return sortBy(elements, e => (e.name || '').toLowerCase());
67378
65341
  }
67379
65342
 
@@ -67480,7 +65443,7 @@
67480
65443
  label: translate('Create new ...')
67481
65444
  }];
67482
65445
  const escalations = findRootElementsByType(getBusinessObject(element), 'bpmn:Escalation');
67483
- sortByName$5(escalations).forEach(escalation => {
65446
+ sortByName$4(escalations).forEach(escalation => {
67484
65447
  options.push({
67485
65448
  value: escalation.get('id'),
67486
65449
  label: escalation.get('name')
@@ -67567,7 +65530,7 @@
67567
65530
  } // helper /////////////////////////
67568
65531
 
67569
65532
 
67570
- function sortByName$5(elements) {
65533
+ function sortByName$4(elements) {
67571
65534
  return sortBy(elements, e => (e.name || '').toLowerCase());
67572
65535
  }
67573
65536
 
@@ -67829,7 +65792,7 @@
67829
65792
  if (message) {
67830
65793
  entries = [...entries, {
67831
65794
  id: 'messageName',
67832
- component: MessageName,
65795
+ component: MessageName$1,
67833
65796
  isEdited: isEdited$1
67834
65797
  }];
67835
65798
  }
@@ -67905,7 +65868,7 @@
67905
65868
  label: translate('Create new ...')
67906
65869
  }];
67907
65870
  const messages = findRootElementsByType(getBusinessObject(element), 'bpmn:Message');
67908
- sortByName$4(messages).forEach(message => {
65871
+ sortByName$3(messages).forEach(message => {
67909
65872
  options.push({
67910
65873
  value: message.get('id'),
67911
65874
  label: message.get('name')
@@ -67914,6 +65877,9 @@
67914
65877
  return options;
67915
65878
  };
67916
65879
 
65880
+ const businessObject = getBusinessObject(element),
65881
+ path = pathConcat(getPath(messageEventDefinition, businessObject), 'messageRef');
65882
+ const show = useShowCallback(businessObject, path);
67917
65883
  return ReferenceSelectEntry({
67918
65884
  element,
67919
65885
  id: 'messageRef',
@@ -67921,11 +65887,12 @@
67921
65887
  autoFocusEntry: 'messageName',
67922
65888
  getValue,
67923
65889
  setValue,
67924
- getOptions
65890
+ getOptions,
65891
+ show
67925
65892
  });
67926
65893
  }
67927
65894
 
67928
- function MessageName(props) {
65895
+ function MessageName$1(props) {
67929
65896
  const {
67930
65897
  element
67931
65898
  } = props;
@@ -67959,7 +65926,7 @@
67959
65926
  } // helper /////////////////////////
67960
65927
 
67961
65928
 
67962
- function sortByName$4(elements) {
65929
+ function sortByName$3(elements) {
67963
65930
  return sortBy(elements, e => (e.name || '').toLowerCase());
67964
65931
  }
67965
65932
 
@@ -68525,7 +66492,7 @@
68525
66492
  label: translate('Create new ...')
68526
66493
  }];
68527
66494
  const signals = findRootElementsByType(getBusinessObject(element), 'bpmn:Signal');
68528
- sortByName$3(signals).forEach(signal => {
66495
+ sortByName$2(signals).forEach(signal => {
68529
66496
  options.push({
68530
66497
  value: signal.get('id'),
68531
66498
  label: signal.get('name')
@@ -68579,7 +66546,7 @@
68579
66546
  } // helper /////////////////////////
68580
66547
 
68581
66548
 
68582
- function sortByName$3(elements) {
66549
+ function sortByName$2(elements) {
68583
66550
  return sortBy(elements, e => (e.name || '').toLowerCase());
68584
66551
  }
68585
66552