@bigbinary/neeto-fields-frontend 1.3.23 → 1.3.24-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8,14 +8,13 @@ import { t } from 'i18next';
8
8
  import * as yup from 'yup';
9
9
  import { Select, Button, ActionBlock as ActionBlock$1, Input as Input$1, Switch, Form } from '@bigbinary/neetoui/formik';
10
10
  import { joinHyphenCase, buildUrl, getQueryParams, dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
11
- import { Check, Delete, Info, Reorder } from '@bigbinary/neeto-icons';
11
+ import { Check, Delete, Reorder } from '@bigbinary/neeto-icons';
12
12
  import { useTranslation, Trans } from 'react-i18next';
13
13
  import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE, PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
14
14
  import Container from '@bigbinary/neeto-molecules/Container';
15
15
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
16
16
  import { useQuery } from 'react-query';
17
17
  import axios from 'axios';
18
- import require$$0 from 'util';
19
18
  import { v4 } from 'uuid';
20
19
  import { buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
21
20
  import { Link, useHistory } from 'react-router-dom';
@@ -23,6 +22,7 @@ import MenuBar from '@bigbinary/neeto-molecules/MenuBar';
23
22
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
24
23
  import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
25
24
  import NeetoUIHeader from '@bigbinary/neeto-molecules/Header';
25
+ import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
26
26
  import { unstable_batchedUpdates, createPortal } from 'react-dom';
27
27
  import NeetoUISubHeader from '@bigbinary/neeto-molecules/SubHeader';
28
28
  import classnames from 'classnames';
@@ -638,7 +638,7 @@ var dayjs_min = {exports: {}};
638
638
  dayjs_min.exports;
639
639
 
640
640
  (function (module, exports) {
641
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
641
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
642
642
  } (dayjs_min, dayjs_min.exports));
643
643
 
644
644
  var dayjs_minExports = dayjs_min.exports;
@@ -978,7 +978,11 @@ var Number$1 = function Number(props) {
978
978
  var individualSubmit = props.individualSubmit,
979
979
  isInline = props.isInline;
980
980
  var showSubmitButton = !isInline && individualSubmit && dirty;
981
- return /*#__PURE__*/React.createElement(Input, _extends({}, fieldProps, {
981
+ return /*#__PURE__*/React.createElement(Input, _extends({}, fieldProps, !isInline && {
982
+ onBlur: function onBlur() {
983
+ return handleSubmit();
984
+ }
985
+ }, {
982
986
  type: "number",
983
987
  suffix: showSubmitButton && /*#__PURE__*/React.createElement(Button, {
984
988
  "data-cy": joinHyphenCase(fieldProps.label, "check-button"),
@@ -1023,2274 +1027,230 @@ var RangePicker = function RangePicker(props) {
1023
1027
  begin = _ref3[0],
1024
1028
  end = _ref3[1];
1025
1029
  if (begin && end) {
1026
- handleSubmit([dateTimeToString(begin), dateTimeToString(end)]);
1027
- } else {
1028
- handleSubmit([]);
1029
- }
1030
- };
1031
- if (props.kind === KINDS.dateRange) {
1032
- return /*#__PURE__*/React.createElement(DateRangePicker, _extends({}, fieldProps, {
1033
- onChange: handleChange
1034
- }));
1035
- }
1036
-
1037
- //time_range
1038
- return /*#__PURE__*/React.createElement(TimeRangePicker, _extends({}, fieldProps, {
1039
- use12Hours: true,
1040
- format: "h:mm A",
1041
- onChange: handleChange
1042
- }));
1043
- };
1044
-
1045
- var SingleOption = function SingleOption(props) {
1046
- var _useFormikFields = useFormikFields(props),
1047
- handleSubmit = _useFormikFields.handleSubmit,
1048
- fieldProps = _useFormikFields.fieldProps;
1049
- return /*#__PURE__*/React.createElement(Select$1, _extends({
1050
- isClearable: true,
1051
- isSearchable: true,
1052
- strategy: "fixed"
1053
- }, fieldProps, {
1054
- onChange: function onChange(option) {
1055
- return handleSubmit((option === null || option === void 0 ? void 0 : option.value) || "");
1056
- }
1057
- }));
1058
- };
1059
-
1060
- var Text = function Text(props) {
1061
- var _useFormikFields = useFormikFields(props),
1062
- handleSubmit = _useFormikFields.handleSubmit,
1063
- fieldProps = _useFormikFields.fieldProps,
1064
- dirty = _useFormikFields.dirty;
1065
- var individualSubmit = props.individualSubmit,
1066
- isInline = props.isInline;
1067
- var showSubmitButton = !isInline && individualSubmit && dirty;
1068
- return /*#__PURE__*/React.createElement(Input, _extends({}, fieldProps, {
1069
- suffix: showSubmitButton && /*#__PURE__*/React.createElement(Button, {
1070
- "data-cy": joinHyphenCase(fieldProps.label, "check-button"),
1071
- icon: Check,
1072
- style: "text",
1073
- onClick: function onClick() {
1074
- return handleSubmit();
1075
- }
1076
- })
1077
- }));
1078
- };
1079
-
1080
- var TextArea = function TextArea(props) {
1081
- var _useTranslation = useTranslation(),
1082
- t = _useTranslation.t;
1083
- var _useFormikFields = useFormikFields(props),
1084
- handleSubmit = _useFormikFields.handleSubmit,
1085
- fieldProps = _useFormikFields.fieldProps,
1086
- dirty = _useFormikFields.dirty;
1087
- var individualSubmit = props.individualSubmit,
1088
- isInline = props.isInline;
1089
- var showSubmitButton = !isInline && individualSubmit && dirty;
1090
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Textarea, fieldProps), showSubmitButton && /*#__PURE__*/React.createElement(Button, {
1091
- className: "m-auto mt-2",
1092
- label: t("neetoFields.labels.submit"),
1093
- size: "small",
1094
- onClick: function onClick() {
1095
- return handleSubmit();
1096
- }
1097
- }));
1098
- };
1099
-
1100
- function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1101
- function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1102
- var standardComponents = {
1103
- text: Text,
1104
- regex: Text,
1105
- textarea: TextArea,
1106
- text_area: TextArea,
1107
- // TODO: Remove text-area after integration in all hosts.
1108
- number: Number$1,
1109
- monetary: Number$1,
1110
- integer: Number$1,
1111
- decimal: Number$1,
1112
- date: DateOrTime,
1113
- time: DateOrTime,
1114
- datetime: DateOrTime,
1115
- single_option: SingleOption,
1116
- multi_option: MultiOption,
1117
- date_range: RangePicker,
1118
- time_range: RangePicker,
1119
- checkbox: Checkbox
1120
- };
1121
- var getFieldInput = function getFieldInput(_ref) {
1122
- var field = _ref.field,
1123
- _ref$customComponents = _ref.customComponents,
1124
- customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents;
1125
- var Component = customComponents[field.kind] || standardComponents[field.kind];
1126
- if (Component) {
1127
- return Component;
1128
- }
1129
- return null;
1130
- };
1131
- var removeItemsWithNullData = function removeItemsWithNullData(fieldValues) {
1132
- return fieldValues.filter(function (item) {
1133
- return !isNil(prop("data", item));
1134
- });
1135
- };
1136
- var removeNoiseFromValues = function removeNoiseFromValues(fieldValues) {
1137
- return map(pick(["id", "fieldId", "data"]), fieldValues);
1138
- };
1139
- var transformValues = function transformValues(_ref2) {
1140
- var formikValues = _ref2.values,
1141
- fields = _ref2.fields;
1142
- var allFieldValues = clone(formikValues);
1143
- var neetoFieldValues = [];
1144
- fields.forEach(function (_ref3) {
1145
- var id = _ref3.id,
1146
- name = _ref3.name;
1147
- var fieldPath = escapeString("".concat(name, "-").concat(id));
1148
- neetoFieldValues.push(allFieldValues[fieldPath]);
1149
- delete allFieldValues[fieldPath];
1150
- });
1151
- var cleanedFieldValues = pipe(removeItemsWithNullData, removeNoiseFromValues)(neetoFieldValues);
1152
- return _objectSpread$f(_objectSpread$f({}, allFieldValues), {}, {
1153
- fieldValuesAttributes: cleanedFieldValues
1154
- });
1155
- };
1156
- var getDefaultInitialValue = function getDefaultInitialValue(kind) {
1157
- switch (kind) {
1158
- case KINDS.checkbox:
1159
- return false;
1160
- case KINDS.multiOption:
1161
- case KINDS.dateRange:
1162
- case KINDS.timeRange:
1163
- return [];
1164
- default:
1165
- return "";
1166
- }
1167
- };
1168
- var getInitialFieldValue = function getInitialFieldValue(_ref4) {
1169
- var field = _ref4.field,
1170
- _ref4$fieldValues = _ref4.fieldValues,
1171
- fieldValues = _ref4$fieldValues === void 0 ? [] : _ref4$fieldValues,
1172
- _ref4$isIndividualFie = _ref4.isIndividualFieldForm,
1173
- isIndividualFieldForm = _ref4$isIndividualFie === void 0 ? false : _ref4$isIndividualFie;
1174
- var existingFieldValueData = findBy({
1175
- fieldId: field.id
1176
- }, fieldValues);
1177
- var keyInData = field.kind === KINDS.multiOption ? "values" : "value";
1178
- var newFieldValueData = {
1179
- fieldId: field.id,
1180
- data: isIndividualFieldForm ? _defineProperty({}, keyInData, getDefaultInitialValue(field.kind)) : null
1181
- };
1182
- return _defineProperty({}, escapeString("".concat(field.name, "-").concat(field.id)), existingFieldValueData || newFieldValueData);
1183
- };
1184
- var getAllInitialFieldValues = function getAllInitialFieldValues(fields) {
1185
- var fieldValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1186
- return getNonSystemFields(fields).map(function (field) {
1187
- return getInitialFieldValue({
1188
- field: field,
1189
- fieldValues: fieldValues
1190
- });
1191
- });
1192
- };
1193
- var mergeInitialValues = function mergeInitialValues(_ref7) {
1194
- var initialValues = _ref7.initialValues,
1195
- fields = _ref7.fields;
1196
- var initialValue = mergeAll([initialValues].concat(_toConsumableArray(getAllInitialFieldValues(fields, initialValues === null || initialValues === void 0 ? void 0 : initialValues.fieldValues))));
1197
- return omit(["fieldValues"], initialValue);
1198
- };
1199
- var getNonSystemFields = function getNonSystemFields(fields) {
1200
- return filterBy({
1201
- isSystem: false
1202
- }, fields);
1203
- };
1204
- var escapeString = function escapeString(string) {
1205
- return string.replace(/[^a-zA-Z0-9_]/g, function (match) {
1206
- var charCode = match.charCodeAt(0);
1207
- return "_".concat(charCode, "_");
1208
- });
1209
- };
1210
- var neetoFieldsUtils = {
1211
- mergeInitialValues: mergeInitialValues,
1212
- transformValues: transformValues
1213
- };
1214
-
1215
- function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1216
- function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1217
- var FieldInputs = withT(function (_ref) {
1218
- var t = _ref.t,
1219
- _ref$customComponents = _ref.customComponents,
1220
- customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents,
1221
- fields = _ref.fields,
1222
- formRef = _ref.formRef,
1223
- disabled = _ref.disabled,
1224
- isRequiredColumnName = _ref.isRequiredColumnName;
1225
- return getNonSystemFields(fields).map(function (field) {
1226
- var Field = getFieldInput({
1227
- field: field,
1228
- customComponents: customComponents
1229
- });
1230
- if (Field) {
1231
- return /*#__PURE__*/React.createElement(Field, _extends({
1232
- key: field.id
1233
- }, _objectSpread$e(_objectSpread$e({}, field), {}, {
1234
- disabled: disabled,
1235
- formRef: formRef,
1236
- isRequiredColumnName: isRequiredColumnName
1237
- })));
1238
- }
1239
- return /*#__PURE__*/React.createElement(Typography, {
1240
- key: field.id,
1241
- style: "body2"
1242
- }, t("neetoFields.messages.invalidKind"));
1243
- });
1244
- });
1245
-
1246
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
1247
- var shams = function hasSymbols() {
1248
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
1249
- if (typeof Symbol.iterator === 'symbol') { return true; }
1250
-
1251
- var obj = {};
1252
- var sym = Symbol('test');
1253
- var symObj = Object(sym);
1254
- if (typeof sym === 'string') { return false; }
1255
-
1256
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
1257
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
1258
-
1259
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
1260
- // if (sym instanceof Symbol) { return false; }
1261
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
1262
- // if (!(symObj instanceof Symbol)) { return false; }
1263
-
1264
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
1265
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
1266
-
1267
- var symVal = 42;
1268
- obj[sym] = symVal;
1269
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
1270
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
1271
-
1272
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
1273
-
1274
- var syms = Object.getOwnPropertySymbols(obj);
1275
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
1276
-
1277
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
1278
-
1279
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
1280
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
1281
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
1282
- }
1283
-
1284
- return true;
1285
- };
1286
-
1287
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
1288
- var hasSymbolSham = shams;
1289
-
1290
- var hasSymbols$1 = function hasNativeSymbols() {
1291
- if (typeof origSymbol !== 'function') { return false; }
1292
- if (typeof Symbol !== 'function') { return false; }
1293
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
1294
- if (typeof Symbol('bar') !== 'symbol') { return false; }
1295
-
1296
- return hasSymbolSham();
1297
- };
1298
-
1299
- var test = {
1300
- foo: {}
1301
- };
1302
-
1303
- var $Object = Object;
1304
-
1305
- var hasProto$1 = function hasProto() {
1306
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
1307
- };
1308
-
1309
- /* eslint no-invalid-this: 1 */
1310
-
1311
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1312
- var slice = Array.prototype.slice;
1313
- var toStr$1 = Object.prototype.toString;
1314
- var funcType = '[object Function]';
1315
-
1316
- var implementation$1 = function bind(that) {
1317
- var target = this;
1318
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
1319
- throw new TypeError(ERROR_MESSAGE + target);
1320
- }
1321
- var args = slice.call(arguments, 1);
1322
-
1323
- var bound;
1324
- var binder = function () {
1325
- if (this instanceof bound) {
1326
- var result = target.apply(
1327
- this,
1328
- args.concat(slice.call(arguments))
1329
- );
1330
- if (Object(result) === result) {
1331
- return result;
1332
- }
1333
- return this;
1334
- } else {
1335
- return target.apply(
1336
- that,
1337
- args.concat(slice.call(arguments))
1338
- );
1339
- }
1340
- };
1341
-
1342
- var boundLength = Math.max(0, target.length - args.length);
1343
- var boundArgs = [];
1344
- for (var i = 0; i < boundLength; i++) {
1345
- boundArgs.push('$' + i);
1346
- }
1347
-
1348
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
1349
-
1350
- if (target.prototype) {
1351
- var Empty = function Empty() {};
1352
- Empty.prototype = target.prototype;
1353
- bound.prototype = new Empty();
1354
- Empty.prototype = null;
1355
- }
1356
-
1357
- return bound;
1358
- };
1359
-
1360
- var implementation = implementation$1;
1361
-
1362
- var functionBind = Function.prototype.bind || implementation;
1363
-
1364
- var bind$1 = functionBind;
1365
-
1366
- var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
1367
-
1368
- var undefined$1;
1369
-
1370
- var $SyntaxError = SyntaxError;
1371
- var $Function = Function;
1372
- var $TypeError$1 = TypeError;
1373
-
1374
- // eslint-disable-next-line consistent-return
1375
- var getEvalledConstructor = function (expressionSyntax) {
1376
- try {
1377
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
1378
- } catch (e) {}
1379
- };
1380
-
1381
- var $gOPD = Object.getOwnPropertyDescriptor;
1382
- if ($gOPD) {
1383
- try {
1384
- $gOPD({}, '');
1385
- } catch (e) {
1386
- $gOPD = null; // this is IE 8, which has a broken gOPD
1387
- }
1388
- }
1389
-
1390
- var throwTypeError = function () {
1391
- throw new $TypeError$1();
1392
- };
1393
- var ThrowTypeError = $gOPD
1394
- ? (function () {
1395
- try {
1396
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
1397
- arguments.callee; // IE 8 does not throw here
1398
- return throwTypeError;
1399
- } catch (calleeThrows) {
1400
- try {
1401
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1402
- return $gOPD(arguments, 'callee').get;
1403
- } catch (gOPDthrows) {
1404
- return throwTypeError;
1405
- }
1406
- }
1407
- }())
1408
- : throwTypeError;
1409
-
1410
- var hasSymbols = hasSymbols$1();
1411
- var hasProto = hasProto$1();
1412
-
1413
- var getProto = Object.getPrototypeOf || (
1414
- hasProto
1415
- ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
1416
- : null
1417
- );
1418
-
1419
- var needsEval = {};
1420
-
1421
- var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
1422
-
1423
- var INTRINSICS = {
1424
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
1425
- '%Array%': Array,
1426
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
1427
- '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
1428
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
1429
- '%AsyncFunction%': needsEval,
1430
- '%AsyncGenerator%': needsEval,
1431
- '%AsyncGeneratorFunction%': needsEval,
1432
- '%AsyncIteratorPrototype%': needsEval,
1433
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
1434
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
1435
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
1436
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
1437
- '%Boolean%': Boolean,
1438
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
1439
- '%Date%': Date,
1440
- '%decodeURI%': decodeURI,
1441
- '%decodeURIComponent%': decodeURIComponent,
1442
- '%encodeURI%': encodeURI,
1443
- '%encodeURIComponent%': encodeURIComponent,
1444
- '%Error%': Error,
1445
- '%eval%': eval, // eslint-disable-line no-eval
1446
- '%EvalError%': EvalError,
1447
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
1448
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
1449
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
1450
- '%Function%': $Function,
1451
- '%GeneratorFunction%': needsEval,
1452
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
1453
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
1454
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
1455
- '%isFinite%': isFinite,
1456
- '%isNaN%': isNaN,
1457
- '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
1458
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
1459
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
1460
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
1461
- '%Math%': Math,
1462
- '%Number%': Number,
1463
- '%Object%': Object,
1464
- '%parseFloat%': parseFloat,
1465
- '%parseInt%': parseInt,
1466
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
1467
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
1468
- '%RangeError%': RangeError,
1469
- '%ReferenceError%': ReferenceError,
1470
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
1471
- '%RegExp%': RegExp,
1472
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
1473
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
1474
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
1475
- '%String%': String,
1476
- '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
1477
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
1478
- '%SyntaxError%': $SyntaxError,
1479
- '%ThrowTypeError%': ThrowTypeError,
1480
- '%TypedArray%': TypedArray,
1481
- '%TypeError%': $TypeError$1,
1482
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
1483
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
1484
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
1485
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
1486
- '%URIError%': URIError,
1487
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
1488
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
1489
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
1490
- };
1491
-
1492
- if (getProto) {
1493
- try {
1494
- null.error; // eslint-disable-line no-unused-expressions
1495
- } catch (e) {
1496
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
1497
- var errorProto = getProto(getProto(e));
1498
- INTRINSICS['%Error.prototype%'] = errorProto;
1499
- }
1500
- }
1501
-
1502
- var doEval = function doEval(name) {
1503
- var value;
1504
- if (name === '%AsyncFunction%') {
1505
- value = getEvalledConstructor('async function () {}');
1506
- } else if (name === '%GeneratorFunction%') {
1507
- value = getEvalledConstructor('function* () {}');
1508
- } else if (name === '%AsyncGeneratorFunction%') {
1509
- value = getEvalledConstructor('async function* () {}');
1510
- } else if (name === '%AsyncGenerator%') {
1511
- var fn = doEval('%AsyncGeneratorFunction%');
1512
- if (fn) {
1513
- value = fn.prototype;
1514
- }
1515
- } else if (name === '%AsyncIteratorPrototype%') {
1516
- var gen = doEval('%AsyncGenerator%');
1517
- if (gen && getProto) {
1518
- value = getProto(gen.prototype);
1519
- }
1520
- }
1521
-
1522
- INTRINSICS[name] = value;
1523
-
1524
- return value;
1525
- };
1526
-
1527
- var LEGACY_ALIASES = {
1528
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1529
- '%ArrayPrototype%': ['Array', 'prototype'],
1530
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1531
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1532
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1533
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1534
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1535
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1536
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1537
- '%BooleanPrototype%': ['Boolean', 'prototype'],
1538
- '%DataViewPrototype%': ['DataView', 'prototype'],
1539
- '%DatePrototype%': ['Date', 'prototype'],
1540
- '%ErrorPrototype%': ['Error', 'prototype'],
1541
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1542
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1543
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1544
- '%FunctionPrototype%': ['Function', 'prototype'],
1545
- '%Generator%': ['GeneratorFunction', 'prototype'],
1546
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1547
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1548
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1549
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1550
- '%JSONParse%': ['JSON', 'parse'],
1551
- '%JSONStringify%': ['JSON', 'stringify'],
1552
- '%MapPrototype%': ['Map', 'prototype'],
1553
- '%NumberPrototype%': ['Number', 'prototype'],
1554
- '%ObjectPrototype%': ['Object', 'prototype'],
1555
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1556
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1557
- '%PromisePrototype%': ['Promise', 'prototype'],
1558
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1559
- '%Promise_all%': ['Promise', 'all'],
1560
- '%Promise_reject%': ['Promise', 'reject'],
1561
- '%Promise_resolve%': ['Promise', 'resolve'],
1562
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1563
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1564
- '%RegExpPrototype%': ['RegExp', 'prototype'],
1565
- '%SetPrototype%': ['Set', 'prototype'],
1566
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1567
- '%StringPrototype%': ['String', 'prototype'],
1568
- '%SymbolPrototype%': ['Symbol', 'prototype'],
1569
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1570
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1571
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1572
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1573
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1574
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1575
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1576
- '%URIErrorPrototype%': ['URIError', 'prototype'],
1577
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1578
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
1579
- };
1580
-
1581
- var bind = functionBind;
1582
- var hasOwn$1 = src;
1583
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
1584
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
1585
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
1586
- var $strSlice = bind.call(Function.call, String.prototype.slice);
1587
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
1588
-
1589
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1590
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1591
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1592
- var stringToPath = function stringToPath(string) {
1593
- var first = $strSlice(string, 0, 1);
1594
- var last = $strSlice(string, -1);
1595
- if (first === '%' && last !== '%') {
1596
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
1597
- } else if (last === '%' && first !== '%') {
1598
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
1599
- }
1600
- var result = [];
1601
- $replace$1(string, rePropName, function (match, number, quote, subString) {
1602
- result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
1603
- });
1604
- return result;
1605
- };
1606
- /* end adaptation */
1607
-
1608
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1609
- var intrinsicName = name;
1610
- var alias;
1611
- if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
1612
- alias = LEGACY_ALIASES[intrinsicName];
1613
- intrinsicName = '%' + alias[0] + '%';
1614
- }
1615
-
1616
- if (hasOwn$1(INTRINSICS, intrinsicName)) {
1617
- var value = INTRINSICS[intrinsicName];
1618
- if (value === needsEval) {
1619
- value = doEval(intrinsicName);
1620
- }
1621
- if (typeof value === 'undefined' && !allowMissing) {
1622
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1623
- }
1624
-
1625
- return {
1626
- alias: alias,
1627
- name: intrinsicName,
1628
- value: value
1629
- };
1630
- }
1631
-
1632
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
1633
- };
1634
-
1635
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
1636
- if (typeof name !== 'string' || name.length === 0) {
1637
- throw new $TypeError$1('intrinsic name must be a non-empty string');
1638
- }
1639
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1640
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
1641
- }
1642
-
1643
- if ($exec(/^%?[^%]*%?$/, name) === null) {
1644
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
1645
- }
1646
- var parts = stringToPath(name);
1647
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1648
-
1649
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1650
- var intrinsicRealName = intrinsic.name;
1651
- var value = intrinsic.value;
1652
- var skipFurtherCaching = false;
1653
-
1654
- var alias = intrinsic.alias;
1655
- if (alias) {
1656
- intrinsicBaseName = alias[0];
1657
- $spliceApply(parts, $concat$1([0, 1], alias));
1658
- }
1659
-
1660
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1661
- var part = parts[i];
1662
- var first = $strSlice(part, 0, 1);
1663
- var last = $strSlice(part, -1);
1664
- if (
1665
- (
1666
- (first === '"' || first === "'" || first === '`')
1667
- || (last === '"' || last === "'" || last === '`')
1668
- )
1669
- && first !== last
1670
- ) {
1671
- throw new $SyntaxError('property names with quotes must have matching quotes');
1672
- }
1673
- if (part === 'constructor' || !isOwn) {
1674
- skipFurtherCaching = true;
1675
- }
1676
-
1677
- intrinsicBaseName += '.' + part;
1678
- intrinsicRealName = '%' + intrinsicBaseName + '%';
1679
-
1680
- if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
1681
- value = INTRINSICS[intrinsicRealName];
1682
- } else if (value != null) {
1683
- if (!(part in value)) {
1684
- if (!allowMissing) {
1685
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
1686
- }
1687
- return void undefined$1;
1688
- }
1689
- if ($gOPD && (i + 1) >= parts.length) {
1690
- var desc = $gOPD(value, part);
1691
- isOwn = !!desc;
1692
-
1693
- // By convention, when a data property is converted to an accessor
1694
- // property to emulate a data property that does not suffer from
1695
- // the override mistake, that accessor's getter is marked with
1696
- // an `originalValue` property. Here, when we detect this, we
1697
- // uphold the illusion by pretending to see that original data
1698
- // property, i.e., returning the value rather than the getter
1699
- // itself.
1700
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1701
- value = desc.get;
1702
- } else {
1703
- value = value[part];
1704
- }
1705
- } else {
1706
- isOwn = hasOwn$1(value, part);
1707
- value = value[part];
1708
- }
1709
-
1710
- if (isOwn && !skipFurtherCaching) {
1711
- INTRINSICS[intrinsicRealName] = value;
1712
- }
1713
- }
1714
- }
1715
- return value;
1716
- };
1717
-
1718
- var callBind$1 = {exports: {}};
1719
-
1720
- callBind$1.exports;
1721
-
1722
- (function (module) {
1723
-
1724
- var bind = functionBind;
1725
- var GetIntrinsic = getIntrinsic;
1726
-
1727
- var $apply = GetIntrinsic('%Function.prototype.apply%');
1728
- var $call = GetIntrinsic('%Function.prototype.call%');
1729
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
1730
-
1731
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
1732
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
1733
- var $max = GetIntrinsic('%Math.max%');
1734
-
1735
- if ($defineProperty) {
1736
- try {
1737
- $defineProperty({}, 'a', { value: 1 });
1738
- } catch (e) {
1739
- // IE 8 has a broken defineProperty
1740
- $defineProperty = null;
1741
- }
1742
- }
1743
-
1744
- module.exports = function callBind(originalFunction) {
1745
- var func = $reflectApply(bind, $call, arguments);
1746
- if ($gOPD && $defineProperty) {
1747
- var desc = $gOPD(func, 'length');
1748
- if (desc.configurable) {
1749
- // original length, plus the receiver, minus any additional arguments (after the receiver)
1750
- $defineProperty(
1751
- func,
1752
- 'length',
1753
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
1754
- );
1755
- }
1756
- }
1757
- return func;
1758
- };
1759
-
1760
- var applyBind = function applyBind() {
1761
- return $reflectApply(bind, $apply, arguments);
1762
- };
1763
-
1764
- if ($defineProperty) {
1765
- $defineProperty(module.exports, 'apply', { value: applyBind });
1766
- } else {
1767
- module.exports.apply = applyBind;
1768
- }
1769
- } (callBind$1));
1770
-
1771
- var callBindExports = callBind$1.exports;
1772
-
1773
- var GetIntrinsic$1 = getIntrinsic;
1774
-
1775
- var callBind = callBindExports;
1776
-
1777
- var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
1778
-
1779
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
1780
- var intrinsic = GetIntrinsic$1(name, !!allowMissing);
1781
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
1782
- return callBind(intrinsic);
1783
- }
1784
- return intrinsic;
1785
- };
1786
-
1787
- var util_inspect = require$$0.inspect;
1788
-
1789
- var hasMap = typeof Map === 'function' && Map.prototype;
1790
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
1791
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
1792
- var mapForEach = hasMap && Map.prototype.forEach;
1793
- var hasSet = typeof Set === 'function' && Set.prototype;
1794
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
1795
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
1796
- var setForEach = hasSet && Set.prototype.forEach;
1797
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
1798
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
1799
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
1800
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
1801
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
1802
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
1803
- var booleanValueOf = Boolean.prototype.valueOf;
1804
- var objectToString = Object.prototype.toString;
1805
- var functionToString = Function.prototype.toString;
1806
- var $match = String.prototype.match;
1807
- var $slice = String.prototype.slice;
1808
- var $replace = String.prototype.replace;
1809
- var $toUpperCase = String.prototype.toUpperCase;
1810
- var $toLowerCase = String.prototype.toLowerCase;
1811
- var $test = RegExp.prototype.test;
1812
- var $concat = Array.prototype.concat;
1813
- var $join = Array.prototype.join;
1814
- var $arrSlice = Array.prototype.slice;
1815
- var $floor = Math.floor;
1816
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
1817
- var gOPS = Object.getOwnPropertySymbols;
1818
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
1819
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
1820
- // ie, `has-tostringtag/shams
1821
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
1822
- ? Symbol.toStringTag
1823
- : null;
1824
- var isEnumerable = Object.prototype.propertyIsEnumerable;
1825
-
1826
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
1827
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
1828
- ? function (O) {
1829
- return O.__proto__; // eslint-disable-line no-proto
1830
- }
1831
- : null
1832
- );
1833
-
1834
- function addNumericSeparator(num, str) {
1835
- if (
1836
- num === Infinity
1837
- || num === -Infinity
1838
- || num !== num
1839
- || (num && num > -1000 && num < 1000)
1840
- || $test.call(/e/, str)
1841
- ) {
1842
- return str;
1843
- }
1844
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1845
- if (typeof num === 'number') {
1846
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
1847
- if (int !== num) {
1848
- var intStr = String(int);
1849
- var dec = $slice.call(str, intStr.length + 1);
1850
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
1851
- }
1852
- }
1853
- return $replace.call(str, sepRegex, '$&_');
1854
- }
1855
-
1856
- var utilInspect = util_inspect;
1857
- var inspectCustom = utilInspect.custom;
1858
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
1859
-
1860
- var objectInspect = function inspect_(obj, options, depth, seen) {
1861
- var opts = options || {};
1862
-
1863
- if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
1864
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
1865
- }
1866
- if (
1867
- has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
1868
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
1869
- : opts.maxStringLength !== null
1870
- )
1871
- ) {
1872
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1873
- }
1874
- var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
1875
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
1876
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
1877
- }
1878
-
1879
- if (
1880
- has$3(opts, 'indent')
1881
- && opts.indent !== null
1882
- && opts.indent !== '\t'
1883
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
1884
- ) {
1885
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1886
- }
1887
- if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
1888
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1889
- }
1890
- var numericSeparator = opts.numericSeparator;
1891
-
1892
- if (typeof obj === 'undefined') {
1893
- return 'undefined';
1894
- }
1895
- if (obj === null) {
1896
- return 'null';
1897
- }
1898
- if (typeof obj === 'boolean') {
1899
- return obj ? 'true' : 'false';
1900
- }
1901
-
1902
- if (typeof obj === 'string') {
1903
- return inspectString(obj, opts);
1904
- }
1905
- if (typeof obj === 'number') {
1906
- if (obj === 0) {
1907
- return Infinity / obj > 0 ? '0' : '-0';
1908
- }
1909
- var str = String(obj);
1910
- return numericSeparator ? addNumericSeparator(obj, str) : str;
1911
- }
1912
- if (typeof obj === 'bigint') {
1913
- var bigIntStr = String(obj) + 'n';
1914
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
1915
- }
1916
-
1917
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
1918
- if (typeof depth === 'undefined') { depth = 0; }
1919
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
1920
- return isArray$3(obj) ? '[Array]' : '[Object]';
1921
- }
1922
-
1923
- var indent = getIndent(opts, depth);
1924
-
1925
- if (typeof seen === 'undefined') {
1926
- seen = [];
1927
- } else if (indexOf(seen, obj) >= 0) {
1928
- return '[Circular]';
1929
- }
1930
-
1931
- function inspect(value, from, noIndent) {
1932
- if (from) {
1933
- seen = $arrSlice.call(seen);
1934
- seen.push(from);
1935
- }
1936
- if (noIndent) {
1937
- var newOpts = {
1938
- depth: opts.depth
1939
- };
1940
- if (has$3(opts, 'quoteStyle')) {
1941
- newOpts.quoteStyle = opts.quoteStyle;
1942
- }
1943
- return inspect_(value, newOpts, depth + 1, seen);
1944
- }
1945
- return inspect_(value, opts, depth + 1, seen);
1946
- }
1947
-
1948
- if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
1949
- var name = nameOf(obj);
1950
- var keys = arrObjKeys(obj, inspect);
1951
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
1952
- }
1953
- if (isSymbol(obj)) {
1954
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
1955
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
1956
- }
1957
- if (isElement(obj)) {
1958
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
1959
- var attrs = obj.attributes || [];
1960
- for (var i = 0; i < attrs.length; i++) {
1961
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
1962
- }
1963
- s += '>';
1964
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
1965
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
1966
- return s;
1967
- }
1968
- if (isArray$3(obj)) {
1969
- if (obj.length === 0) { return '[]'; }
1970
- var xs = arrObjKeys(obj, inspect);
1971
- if (indent && !singleLineValues(xs)) {
1972
- return '[' + indentedJoin(xs, indent) + ']';
1973
- }
1974
- return '[ ' + $join.call(xs, ', ') + ' ]';
1975
- }
1976
- if (isError(obj)) {
1977
- var parts = arrObjKeys(obj, inspect);
1978
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
1979
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
1980
- }
1981
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
1982
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
1983
- }
1984
- if (typeof obj === 'object' && customInspect) {
1985
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
1986
- return utilInspect(obj, { depth: maxDepth - depth });
1987
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
1988
- return obj.inspect();
1989
- }
1990
- }
1991
- if (isMap(obj)) {
1992
- var mapParts = [];
1993
- if (mapForEach) {
1994
- mapForEach.call(obj, function (value, key) {
1995
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
1996
- });
1997
- }
1998
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
1999
- }
2000
- if (isSet(obj)) {
2001
- var setParts = [];
2002
- if (setForEach) {
2003
- setForEach.call(obj, function (value) {
2004
- setParts.push(inspect(value, obj));
2005
- });
2006
- }
2007
- return collectionOf('Set', setSize.call(obj), setParts, indent);
2008
- }
2009
- if (isWeakMap(obj)) {
2010
- return weakCollectionOf('WeakMap');
2011
- }
2012
- if (isWeakSet(obj)) {
2013
- return weakCollectionOf('WeakSet');
2014
- }
2015
- if (isWeakRef(obj)) {
2016
- return weakCollectionOf('WeakRef');
2017
- }
2018
- if (isNumber(obj)) {
2019
- return markBoxed(inspect(Number(obj)));
2020
- }
2021
- if (isBigInt(obj)) {
2022
- return markBoxed(inspect(bigIntValueOf.call(obj)));
2023
- }
2024
- if (isBoolean(obj)) {
2025
- return markBoxed(booleanValueOf.call(obj));
2026
- }
2027
- if (isString(obj)) {
2028
- return markBoxed(inspect(String(obj)));
2029
- }
2030
- if (!isDate(obj) && !isRegExp$1(obj)) {
2031
- var ys = arrObjKeys(obj, inspect);
2032
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
2033
- var protoTag = obj instanceof Object ? '' : 'null prototype';
2034
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
2035
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
2036
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
2037
- if (ys.length === 0) { return tag + '{}'; }
2038
- if (indent) {
2039
- return tag + '{' + indentedJoin(ys, indent) + '}';
2040
- }
2041
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
2042
- }
2043
- return String(obj);
2044
- };
2045
-
2046
- function wrapQuotes(s, defaultStyle, opts) {
2047
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
2048
- return quoteChar + s + quoteChar;
2049
- }
2050
-
2051
- function quote(s) {
2052
- return $replace.call(String(s), /"/g, '&quot;');
2053
- }
2054
-
2055
- function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2056
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2057
- function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2058
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2059
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2060
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2061
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
2062
-
2063
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
2064
- function isSymbol(obj) {
2065
- if (hasShammedSymbols) {
2066
- return obj && typeof obj === 'object' && obj instanceof Symbol;
2067
- }
2068
- if (typeof obj === 'symbol') {
2069
- return true;
2070
- }
2071
- if (!obj || typeof obj !== 'object' || !symToString) {
2072
- return false;
2073
- }
2074
- try {
2075
- symToString.call(obj);
2076
- return true;
2077
- } catch (e) {}
2078
- return false;
2079
- }
2080
-
2081
- function isBigInt(obj) {
2082
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
2083
- return false;
2084
- }
2085
- try {
2086
- bigIntValueOf.call(obj);
2087
- return true;
2088
- } catch (e) {}
2089
- return false;
2090
- }
2091
-
2092
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
2093
- function has$3(obj, key) {
2094
- return hasOwn.call(obj, key);
2095
- }
2096
-
2097
- function toStr(obj) {
2098
- return objectToString.call(obj);
2099
- }
2100
-
2101
- function nameOf(f) {
2102
- if (f.name) { return f.name; }
2103
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
2104
- if (m) { return m[1]; }
2105
- return null;
2106
- }
2107
-
2108
- function indexOf(xs, x) {
2109
- if (xs.indexOf) { return xs.indexOf(x); }
2110
- for (var i = 0, l = xs.length; i < l; i++) {
2111
- if (xs[i] === x) { return i; }
2112
- }
2113
- return -1;
2114
- }
2115
-
2116
- function isMap(x) {
2117
- if (!mapSize || !x || typeof x !== 'object') {
2118
- return false;
2119
- }
2120
- try {
2121
- mapSize.call(x);
2122
- try {
2123
- setSize.call(x);
2124
- } catch (s) {
2125
- return true;
2126
- }
2127
- return x instanceof Map; // core-js workaround, pre-v2.5.0
2128
- } catch (e) {}
2129
- return false;
2130
- }
2131
-
2132
- function isWeakMap(x) {
2133
- if (!weakMapHas || !x || typeof x !== 'object') {
2134
- return false;
2135
- }
2136
- try {
2137
- weakMapHas.call(x, weakMapHas);
2138
- try {
2139
- weakSetHas.call(x, weakSetHas);
2140
- } catch (s) {
2141
- return true;
2142
- }
2143
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
2144
- } catch (e) {}
2145
- return false;
2146
- }
2147
-
2148
- function isWeakRef(x) {
2149
- if (!weakRefDeref || !x || typeof x !== 'object') {
2150
- return false;
2151
- }
2152
- try {
2153
- weakRefDeref.call(x);
2154
- return true;
2155
- } catch (e) {}
2156
- return false;
2157
- }
2158
-
2159
- function isSet(x) {
2160
- if (!setSize || !x || typeof x !== 'object') {
2161
- return false;
2162
- }
2163
- try {
2164
- setSize.call(x);
2165
- try {
2166
- mapSize.call(x);
2167
- } catch (m) {
2168
- return true;
2169
- }
2170
- return x instanceof Set; // core-js workaround, pre-v2.5.0
2171
- } catch (e) {}
2172
- return false;
2173
- }
2174
-
2175
- function isWeakSet(x) {
2176
- if (!weakSetHas || !x || typeof x !== 'object') {
2177
- return false;
2178
- }
2179
- try {
2180
- weakSetHas.call(x, weakSetHas);
2181
- try {
2182
- weakMapHas.call(x, weakMapHas);
2183
- } catch (s) {
2184
- return true;
2185
- }
2186
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
2187
- } catch (e) {}
2188
- return false;
2189
- }
2190
-
2191
- function isElement(x) {
2192
- if (!x || typeof x !== 'object') { return false; }
2193
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
2194
- return true;
2195
- }
2196
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
2197
- }
2198
-
2199
- function inspectString(str, opts) {
2200
- if (str.length > opts.maxStringLength) {
2201
- var remaining = str.length - opts.maxStringLength;
2202
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
2203
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
2204
- }
2205
- // eslint-disable-next-line no-control-regex
2206
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
2207
- return wrapQuotes(s, 'single', opts);
2208
- }
2209
-
2210
- function lowbyte(c) {
2211
- var n = c.charCodeAt(0);
2212
- var x = {
2213
- 8: 'b',
2214
- 9: 't',
2215
- 10: 'n',
2216
- 12: 'f',
2217
- 13: 'r'
2218
- }[n];
2219
- if (x) { return '\\' + x; }
2220
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
2221
- }
2222
-
2223
- function markBoxed(str) {
2224
- return 'Object(' + str + ')';
2225
- }
2226
-
2227
- function weakCollectionOf(type) {
2228
- return type + ' { ? }';
2229
- }
2230
-
2231
- function collectionOf(type, size, entries, indent) {
2232
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
2233
- return type + ' (' + size + ') {' + joinedEntries + '}';
2234
- }
2235
-
2236
- function singleLineValues(xs) {
2237
- for (var i = 0; i < xs.length; i++) {
2238
- if (indexOf(xs[i], '\n') >= 0) {
2239
- return false;
2240
- }
2241
- }
2242
- return true;
2243
- }
2244
-
2245
- function getIndent(opts, depth) {
2246
- var baseIndent;
2247
- if (opts.indent === '\t') {
2248
- baseIndent = '\t';
2249
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
2250
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
2251
- } else {
2252
- return null;
2253
- }
2254
- return {
2255
- base: baseIndent,
2256
- prev: $join.call(Array(depth + 1), baseIndent)
2257
- };
2258
- }
2259
-
2260
- function indentedJoin(xs, indent) {
2261
- if (xs.length === 0) { return ''; }
2262
- var lineJoiner = '\n' + indent.prev + indent.base;
2263
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
2264
- }
2265
-
2266
- function arrObjKeys(obj, inspect) {
2267
- var isArr = isArray$3(obj);
2268
- var xs = [];
2269
- if (isArr) {
2270
- xs.length = obj.length;
2271
- for (var i = 0; i < obj.length; i++) {
2272
- xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
2273
- }
2274
- }
2275
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
2276
- var symMap;
2277
- if (hasShammedSymbols) {
2278
- symMap = {};
2279
- for (var k = 0; k < syms.length; k++) {
2280
- symMap['$' + syms[k]] = syms[k];
2281
- }
2282
- }
2283
-
2284
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
2285
- if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
2286
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
2287
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
2288
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
2289
- continue; // eslint-disable-line no-restricted-syntax, no-continue
2290
- } else if ($test.call(/[^\w$]/, key)) {
2291
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
2292
- } else {
2293
- xs.push(key + ': ' + inspect(obj[key], obj));
2294
- }
2295
- }
2296
- if (typeof gOPS === 'function') {
2297
- for (var j = 0; j < syms.length; j++) {
2298
- if (isEnumerable.call(obj, syms[j])) {
2299
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
2300
- }
2301
- }
2302
- }
2303
- return xs;
2304
- }
2305
-
2306
- var GetIntrinsic = getIntrinsic;
2307
- var callBound = callBound$1;
2308
- var inspect = objectInspect;
2309
-
2310
- var $TypeError = GetIntrinsic('%TypeError%');
2311
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
2312
- var $Map = GetIntrinsic('%Map%', true);
2313
-
2314
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
2315
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
2316
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
2317
- var $mapGet = callBound('Map.prototype.get', true);
2318
- var $mapSet = callBound('Map.prototype.set', true);
2319
- var $mapHas = callBound('Map.prototype.has', true);
2320
-
2321
- /*
2322
- * This function traverses the list returning the node corresponding to the
2323
- * given key.
2324
- *
2325
- * That node is also moved to the head of the list, so that if it's accessed
2326
- * again we don't need to traverse the whole list. By doing so, all the recently
2327
- * used nodes can be accessed relatively quickly.
2328
- */
2329
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
2330
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
2331
- if (curr.key === key) {
2332
- prev.next = curr.next;
2333
- curr.next = list.next;
2334
- list.next = curr; // eslint-disable-line no-param-reassign
2335
- return curr;
2336
- }
2337
- }
2338
- };
2339
-
2340
- var listGet = function (objects, key) {
2341
- var node = listGetNode(objects, key);
2342
- return node && node.value;
2343
- };
2344
- var listSet = function (objects, key, value) {
2345
- var node = listGetNode(objects, key);
2346
- if (node) {
2347
- node.value = value;
2348
- } else {
2349
- // Prepend the new node to the beginning of the list
2350
- objects.next = { // eslint-disable-line no-param-reassign
2351
- key: key,
2352
- next: objects.next,
2353
- value: value
2354
- };
2355
- }
2356
- };
2357
- var listHas = function (objects, key) {
2358
- return !!listGetNode(objects, key);
2359
- };
2360
-
2361
- var sideChannel = function getSideChannel() {
2362
- var $wm;
2363
- var $m;
2364
- var $o;
2365
- var channel = {
2366
- assert: function (key) {
2367
- if (!channel.has(key)) {
2368
- throw new $TypeError('Side channel does not contain ' + inspect(key));
2369
- }
2370
- },
2371
- get: function (key) { // eslint-disable-line consistent-return
2372
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2373
- if ($wm) {
2374
- return $weakMapGet($wm, key);
2375
- }
2376
- } else if ($Map) {
2377
- if ($m) {
2378
- return $mapGet($m, key);
2379
- }
2380
- } else {
2381
- if ($o) { // eslint-disable-line no-lonely-if
2382
- return listGet($o, key);
2383
- }
2384
- }
2385
- },
2386
- has: function (key) {
2387
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2388
- if ($wm) {
2389
- return $weakMapHas($wm, key);
2390
- }
2391
- } else if ($Map) {
2392
- if ($m) {
2393
- return $mapHas($m, key);
2394
- }
2395
- } else {
2396
- if ($o) { // eslint-disable-line no-lonely-if
2397
- return listHas($o, key);
2398
- }
2399
- }
2400
- return false;
2401
- },
2402
- set: function (key, value) {
2403
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
2404
- if (!$wm) {
2405
- $wm = new $WeakMap();
2406
- }
2407
- $weakMapSet($wm, key, value);
2408
- } else if ($Map) {
2409
- if (!$m) {
2410
- $m = new $Map();
2411
- }
2412
- $mapSet($m, key, value);
2413
- } else {
2414
- if (!$o) {
2415
- /*
2416
- * Initialize the linked list as an empty node, so that we don't have
2417
- * to special-case handling of the first node: we can always refer to
2418
- * it as (previous node).next, instead of something like (list).head
2419
- */
2420
- $o = { key: {}, next: null };
2421
- }
2422
- listSet($o, key, value);
2423
- }
2424
- }
2425
- };
2426
- return channel;
2427
- };
2428
-
2429
- var replace = String.prototype.replace;
2430
- var percentTwenties = /%20/g;
2431
-
2432
- var Format = {
2433
- RFC1738: 'RFC1738',
2434
- RFC3986: 'RFC3986'
2435
- };
2436
-
2437
- var formats$3 = {
2438
- 'default': Format.RFC3986,
2439
- formatters: {
2440
- RFC1738: function (value) {
2441
- return replace.call(value, percentTwenties, '+');
2442
- },
2443
- RFC3986: function (value) {
2444
- return String(value);
2445
- }
2446
- },
2447
- RFC1738: Format.RFC1738,
2448
- RFC3986: Format.RFC3986
2449
- };
2450
-
2451
- var formats$2 = formats$3;
2452
-
2453
- var has$2 = Object.prototype.hasOwnProperty;
2454
- var isArray$2 = Array.isArray;
2455
-
2456
- var hexTable = (function () {
2457
- var array = [];
2458
- for (var i = 0; i < 256; ++i) {
2459
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
2460
- }
2461
-
2462
- return array;
2463
- }());
2464
-
2465
- var compactQueue = function compactQueue(queue) {
2466
- while (queue.length > 1) {
2467
- var item = queue.pop();
2468
- var obj = item.obj[item.prop];
2469
-
2470
- if (isArray$2(obj)) {
2471
- var compacted = [];
2472
-
2473
- for (var j = 0; j < obj.length; ++j) {
2474
- if (typeof obj[j] !== 'undefined') {
2475
- compacted.push(obj[j]);
2476
- }
2477
- }
2478
-
2479
- item.obj[item.prop] = compacted;
2480
- }
2481
- }
2482
- };
2483
-
2484
- var arrayToObject = function arrayToObject(source, options) {
2485
- var obj = options && options.plainObjects ? Object.create(null) : {};
2486
- for (var i = 0; i < source.length; ++i) {
2487
- if (typeof source[i] !== 'undefined') {
2488
- obj[i] = source[i];
2489
- }
2490
- }
2491
-
2492
- return obj;
2493
- };
2494
-
2495
- var merge = function merge(target, source, options) {
2496
- /* eslint no-param-reassign: 0 */
2497
- if (!source) {
2498
- return target;
2499
- }
2500
-
2501
- if (typeof source !== 'object') {
2502
- if (isArray$2(target)) {
2503
- target.push(source);
2504
- } else if (target && typeof target === 'object') {
2505
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
2506
- target[source] = true;
2507
- }
2508
- } else {
2509
- return [target, source];
2510
- }
2511
-
2512
- return target;
2513
- }
2514
-
2515
- if (!target || typeof target !== 'object') {
2516
- return [target].concat(source);
2517
- }
2518
-
2519
- var mergeTarget = target;
2520
- if (isArray$2(target) && !isArray$2(source)) {
2521
- mergeTarget = arrayToObject(target, options);
2522
- }
2523
-
2524
- if (isArray$2(target) && isArray$2(source)) {
2525
- source.forEach(function (item, i) {
2526
- if (has$2.call(target, i)) {
2527
- var targetItem = target[i];
2528
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
2529
- target[i] = merge(targetItem, item, options);
2530
- } else {
2531
- target.push(item);
2532
- }
2533
- } else {
2534
- target[i] = item;
2535
- }
2536
- });
2537
- return target;
2538
- }
2539
-
2540
- return Object.keys(source).reduce(function (acc, key) {
2541
- var value = source[key];
2542
-
2543
- if (has$2.call(acc, key)) {
2544
- acc[key] = merge(acc[key], value, options);
2545
- } else {
2546
- acc[key] = value;
2547
- }
2548
- return acc;
2549
- }, mergeTarget);
2550
- };
2551
-
2552
- var assign = function assignSingleSource(target, source) {
2553
- return Object.keys(source).reduce(function (acc, key) {
2554
- acc[key] = source[key];
2555
- return acc;
2556
- }, target);
2557
- };
2558
-
2559
- var decode = function (str, decoder, charset) {
2560
- var strWithoutPlus = str.replace(/\+/g, ' ');
2561
- if (charset === 'iso-8859-1') {
2562
- // unescape never throws, no try...catch needed:
2563
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
2564
- }
2565
- // utf-8
2566
- try {
2567
- return decodeURIComponent(strWithoutPlus);
2568
- } catch (e) {
2569
- return strWithoutPlus;
2570
- }
2571
- };
2572
-
2573
- var encode = function encode(str, defaultEncoder, charset, kind, format) {
2574
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
2575
- // It has been adapted here for stricter adherence to RFC 3986
2576
- if (str.length === 0) {
2577
- return str;
2578
- }
2579
-
2580
- var string = str;
2581
- if (typeof str === 'symbol') {
2582
- string = Symbol.prototype.toString.call(str);
2583
- } else if (typeof str !== 'string') {
2584
- string = String(str);
2585
- }
2586
-
2587
- if (charset === 'iso-8859-1') {
2588
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
2589
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
2590
- });
2591
- }
2592
-
2593
- var out = '';
2594
- for (var i = 0; i < string.length; ++i) {
2595
- var c = string.charCodeAt(i);
2596
-
2597
- if (
2598
- c === 0x2D // -
2599
- || c === 0x2E // .
2600
- || c === 0x5F // _
2601
- || c === 0x7E // ~
2602
- || (c >= 0x30 && c <= 0x39) // 0-9
2603
- || (c >= 0x41 && c <= 0x5A) // a-z
2604
- || (c >= 0x61 && c <= 0x7A) // A-Z
2605
- || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
2606
- ) {
2607
- out += string.charAt(i);
2608
- continue;
2609
- }
2610
-
2611
- if (c < 0x80) {
2612
- out = out + hexTable[c];
2613
- continue;
2614
- }
2615
-
2616
- if (c < 0x800) {
2617
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
2618
- continue;
2619
- }
2620
-
2621
- if (c < 0xD800 || c >= 0xE000) {
2622
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
2623
- continue;
2624
- }
2625
-
2626
- i += 1;
2627
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
2628
- /* eslint operator-linebreak: [2, "before"] */
2629
- out += hexTable[0xF0 | (c >> 18)]
2630
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
2631
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
2632
- + hexTable[0x80 | (c & 0x3F)];
2633
- }
2634
-
2635
- return out;
2636
- };
2637
-
2638
- var compact = function compact(value) {
2639
- var queue = [{ obj: { o: value }, prop: 'o' }];
2640
- var refs = [];
2641
-
2642
- for (var i = 0; i < queue.length; ++i) {
2643
- var item = queue[i];
2644
- var obj = item.obj[item.prop];
2645
-
2646
- var keys = Object.keys(obj);
2647
- for (var j = 0; j < keys.length; ++j) {
2648
- var key = keys[j];
2649
- var val = obj[key];
2650
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
2651
- queue.push({ obj: obj, prop: key });
2652
- refs.push(val);
2653
- }
2654
- }
2655
- }
2656
-
2657
- compactQueue(queue);
2658
-
2659
- return value;
2660
- };
2661
-
2662
- var isRegExp = function isRegExp(obj) {
2663
- return Object.prototype.toString.call(obj) === '[object RegExp]';
2664
- };
2665
-
2666
- var isBuffer = function isBuffer(obj) {
2667
- if (!obj || typeof obj !== 'object') {
2668
- return false;
2669
- }
2670
-
2671
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
2672
- };
2673
-
2674
- var combine = function combine(a, b) {
2675
- return [].concat(a, b);
2676
- };
2677
-
2678
- var maybeMap = function maybeMap(val, fn) {
2679
- if (isArray$2(val)) {
2680
- var mapped = [];
2681
- for (var i = 0; i < val.length; i += 1) {
2682
- mapped.push(fn(val[i]));
2683
- }
2684
- return mapped;
2685
- }
2686
- return fn(val);
2687
- };
2688
-
2689
- var utils$2 = {
2690
- arrayToObject: arrayToObject,
2691
- assign: assign,
2692
- combine: combine,
2693
- compact: compact,
2694
- decode: decode,
2695
- encode: encode,
2696
- isBuffer: isBuffer,
2697
- isRegExp: isRegExp,
2698
- maybeMap: maybeMap,
2699
- merge: merge
2700
- };
2701
-
2702
- var getSideChannel = sideChannel;
2703
- var utils$1 = utils$2;
2704
- var formats$1 = formats$3;
2705
- var has$1 = Object.prototype.hasOwnProperty;
2706
-
2707
- var arrayPrefixGenerators = {
2708
- brackets: function brackets(prefix) {
2709
- return prefix + '[]';
2710
- },
2711
- comma: 'comma',
2712
- indices: function indices(prefix, key) {
2713
- return prefix + '[' + key + ']';
2714
- },
2715
- repeat: function repeat(prefix) {
2716
- return prefix;
2717
- }
2718
- };
2719
-
2720
- var isArray$1 = Array.isArray;
2721
- var push = Array.prototype.push;
2722
- var pushToArray = function (arr, valueOrArray) {
2723
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
2724
- };
2725
-
2726
- var toISO = Date.prototype.toISOString;
2727
-
2728
- var defaultFormat = formats$1['default'];
2729
- var defaults$1 = {
2730
- addQueryPrefix: false,
2731
- allowDots: false,
2732
- charset: 'utf-8',
2733
- charsetSentinel: false,
2734
- delimiter: '&',
2735
- encode: true,
2736
- encoder: utils$1.encode,
2737
- encodeValuesOnly: false,
2738
- format: defaultFormat,
2739
- formatter: formats$1.formatters[defaultFormat],
2740
- // deprecated
2741
- indices: false,
2742
- serializeDate: function serializeDate(date) {
2743
- return toISO.call(date);
2744
- },
2745
- skipNulls: false,
2746
- strictNullHandling: false
2747
- };
2748
-
2749
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
2750
- return typeof v === 'string'
2751
- || typeof v === 'number'
2752
- || typeof v === 'boolean'
2753
- || typeof v === 'symbol'
2754
- || typeof v === 'bigint';
2755
- };
2756
-
2757
- var sentinel = {};
2758
-
2759
- var stringify$1 = function stringify(
2760
- object,
2761
- prefix,
2762
- generateArrayPrefix,
2763
- commaRoundTrip,
2764
- strictNullHandling,
2765
- skipNulls,
2766
- encoder,
2767
- filter,
2768
- sort,
2769
- allowDots,
2770
- serializeDate,
2771
- format,
2772
- formatter,
2773
- encodeValuesOnly,
2774
- charset,
2775
- sideChannel
2776
- ) {
2777
- var obj = object;
2778
-
2779
- var tmpSc = sideChannel;
2780
- var step = 0;
2781
- var findFlag = false;
2782
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
2783
- // Where object last appeared in the ref tree
2784
- var pos = tmpSc.get(object);
2785
- step += 1;
2786
- if (typeof pos !== 'undefined') {
2787
- if (pos === step) {
2788
- throw new RangeError('Cyclic object value');
2789
- } else {
2790
- findFlag = true; // Break while
2791
- }
2792
- }
2793
- if (typeof tmpSc.get(sentinel) === 'undefined') {
2794
- step = 0;
2795
- }
2796
- }
2797
-
2798
- if (typeof filter === 'function') {
2799
- obj = filter(prefix, obj);
2800
- } else if (obj instanceof Date) {
2801
- obj = serializeDate(obj);
2802
- } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
2803
- obj = utils$1.maybeMap(obj, function (value) {
2804
- if (value instanceof Date) {
2805
- return serializeDate(value);
2806
- }
2807
- return value;
2808
- });
2809
- }
2810
-
2811
- if (obj === null) {
2812
- if (strictNullHandling) {
2813
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
2814
- }
2815
-
2816
- obj = '';
2817
- }
2818
-
2819
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
2820
- if (encoder) {
2821
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
2822
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
2823
- }
2824
- return [formatter(prefix) + '=' + formatter(String(obj))];
2825
- }
2826
-
2827
- var values = [];
2828
-
2829
- if (typeof obj === 'undefined') {
2830
- return values;
2831
- }
2832
-
2833
- var objKeys;
2834
- if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
2835
- // we need to join elements in
2836
- if (encodeValuesOnly && encoder) {
2837
- obj = utils$1.maybeMap(obj, encoder);
2838
- }
2839
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
2840
- } else if (isArray$1(filter)) {
2841
- objKeys = filter;
2842
- } else {
2843
- var keys = Object.keys(obj);
2844
- objKeys = sort ? keys.sort(sort) : keys;
2845
- }
2846
-
2847
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
2848
-
2849
- for (var j = 0; j < objKeys.length; ++j) {
2850
- var key = objKeys[j];
2851
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
2852
-
2853
- if (skipNulls && value === null) {
2854
- continue;
2855
- }
2856
-
2857
- var keyPrefix = isArray$1(obj)
2858
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
2859
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
2860
-
2861
- sideChannel.set(object, step);
2862
- var valueSideChannel = getSideChannel();
2863
- valueSideChannel.set(sentinel, sideChannel);
2864
- pushToArray(values, stringify(
2865
- value,
2866
- keyPrefix,
2867
- generateArrayPrefix,
2868
- commaRoundTrip,
2869
- strictNullHandling,
2870
- skipNulls,
2871
- generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
2872
- filter,
2873
- sort,
2874
- allowDots,
2875
- serializeDate,
2876
- format,
2877
- formatter,
2878
- encodeValuesOnly,
2879
- charset,
2880
- valueSideChannel
2881
- ));
2882
- }
2883
-
2884
- return values;
2885
- };
2886
-
2887
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
2888
- if (!opts) {
2889
- return defaults$1;
2890
- }
2891
-
2892
- if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
2893
- throw new TypeError('Encoder has to be a function.');
2894
- }
2895
-
2896
- var charset = opts.charset || defaults$1.charset;
2897
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2898
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2899
- }
2900
-
2901
- var format = formats$1['default'];
2902
- if (typeof opts.format !== 'undefined') {
2903
- if (!has$1.call(formats$1.formatters, opts.format)) {
2904
- throw new TypeError('Unknown format option provided.');
2905
- }
2906
- format = opts.format;
2907
- }
2908
- var formatter = formats$1.formatters[format];
2909
-
2910
- var filter = defaults$1.filter;
2911
- if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
2912
- filter = opts.filter;
2913
- }
2914
-
2915
- return {
2916
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
2917
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
2918
- charset: charset,
2919
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
2920
- delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
2921
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
2922
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
2923
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
2924
- filter: filter,
2925
- format: format,
2926
- formatter: formatter,
2927
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
2928
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
2929
- sort: typeof opts.sort === 'function' ? opts.sort : null,
2930
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
2931
- };
2932
- };
2933
-
2934
- var stringify_1 = function (object, opts) {
2935
- var obj = object;
2936
- var options = normalizeStringifyOptions(opts);
2937
-
2938
- var objKeys;
2939
- var filter;
2940
-
2941
- if (typeof options.filter === 'function') {
2942
- filter = options.filter;
2943
- obj = filter('', obj);
2944
- } else if (isArray$1(options.filter)) {
2945
- filter = options.filter;
2946
- objKeys = filter;
2947
- }
2948
-
2949
- var keys = [];
2950
-
2951
- if (typeof obj !== 'object' || obj === null) {
2952
- return '';
2953
- }
2954
-
2955
- var arrayFormat;
2956
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
2957
- arrayFormat = opts.arrayFormat;
2958
- } else if (opts && 'indices' in opts) {
2959
- arrayFormat = opts.indices ? 'indices' : 'repeat';
2960
- } else {
2961
- arrayFormat = 'indices';
2962
- }
2963
-
2964
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2965
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2966
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2967
- }
2968
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
2969
-
2970
- if (!objKeys) {
2971
- objKeys = Object.keys(obj);
2972
- }
2973
-
2974
- if (options.sort) {
2975
- objKeys.sort(options.sort);
2976
- }
2977
-
2978
- var sideChannel = getSideChannel();
2979
- for (var i = 0; i < objKeys.length; ++i) {
2980
- var key = objKeys[i];
2981
-
2982
- if (options.skipNulls && obj[key] === null) {
2983
- continue;
2984
- }
2985
- pushToArray(keys, stringify$1(
2986
- obj[key],
2987
- key,
2988
- generateArrayPrefix,
2989
- commaRoundTrip,
2990
- options.strictNullHandling,
2991
- options.skipNulls,
2992
- options.encode ? options.encoder : null,
2993
- options.filter,
2994
- options.sort,
2995
- options.allowDots,
2996
- options.serializeDate,
2997
- options.format,
2998
- options.formatter,
2999
- options.encodeValuesOnly,
3000
- options.charset,
3001
- sideChannel
3002
- ));
3003
- }
3004
-
3005
- var joined = keys.join(options.delimiter);
3006
- var prefix = options.addQueryPrefix === true ? '?' : '';
3007
-
3008
- if (options.charsetSentinel) {
3009
- if (options.charset === 'iso-8859-1') {
3010
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
3011
- prefix += 'utf8=%26%2310003%3B&';
3012
- } else {
3013
- // encodeURIComponent('✓')
3014
- prefix += 'utf8=%E2%9C%93&';
3015
- }
3016
- }
3017
-
3018
- return joined.length > 0 ? prefix + joined : '';
3019
- };
3020
-
3021
- var utils = utils$2;
3022
-
3023
- var has = Object.prototype.hasOwnProperty;
3024
- var isArray = Array.isArray;
3025
-
3026
- var defaults = {
3027
- allowDots: false,
3028
- allowPrototypes: false,
3029
- allowSparse: false,
3030
- arrayLimit: 20,
3031
- charset: 'utf-8',
3032
- charsetSentinel: false,
3033
- comma: false,
3034
- decoder: utils.decode,
3035
- delimiter: '&',
3036
- depth: 5,
3037
- ignoreQueryPrefix: false,
3038
- interpretNumericEntities: false,
3039
- parameterLimit: 1000,
3040
- parseArrays: true,
3041
- plainObjects: false,
3042
- strictNullHandling: false
3043
- };
3044
-
3045
- var interpretNumericEntities = function (str) {
3046
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
3047
- return String.fromCharCode(parseInt(numberStr, 10));
3048
- });
3049
- };
3050
-
3051
- var parseArrayValue = function (val, options) {
3052
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
3053
- return val.split(',');
3054
- }
3055
-
3056
- return val;
3057
- };
3058
-
3059
- // This is what browsers will submit when the ✓ character occurs in an
3060
- // application/x-www-form-urlencoded body and the encoding of the page containing
3061
- // the form is iso-8859-1, or when the submitted form has an accept-charset
3062
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
3063
- // the ✓ character, such as us-ascii.
3064
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
3065
-
3066
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
3067
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
3068
-
3069
- var parseValues = function parseQueryStringValues(str, options) {
3070
- var obj = { __proto__: null };
3071
-
3072
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
3073
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
3074
- var parts = cleanStr.split(options.delimiter, limit);
3075
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
3076
- var i;
3077
-
3078
- var charset = options.charset;
3079
- if (options.charsetSentinel) {
3080
- for (i = 0; i < parts.length; ++i) {
3081
- if (parts[i].indexOf('utf8=') === 0) {
3082
- if (parts[i] === charsetSentinel) {
3083
- charset = 'utf-8';
3084
- } else if (parts[i] === isoSentinel) {
3085
- charset = 'iso-8859-1';
3086
- }
3087
- skipIndex = i;
3088
- i = parts.length; // The eslint settings do not allow break;
3089
- }
3090
- }
3091
- }
3092
-
3093
- for (i = 0; i < parts.length; ++i) {
3094
- if (i === skipIndex) {
3095
- continue;
3096
- }
3097
- var part = parts[i];
3098
-
3099
- var bracketEqualsPos = part.indexOf(']=');
3100
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
3101
-
3102
- var key, val;
3103
- if (pos === -1) {
3104
- key = options.decoder(part, defaults.decoder, charset, 'key');
3105
- val = options.strictNullHandling ? null : '';
3106
- } else {
3107
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
3108
- val = utils.maybeMap(
3109
- parseArrayValue(part.slice(pos + 1), options),
3110
- function (encodedVal) {
3111
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
3112
- }
3113
- );
3114
- }
3115
-
3116
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
3117
- val = interpretNumericEntities(val);
3118
- }
3119
-
3120
- if (part.indexOf('[]=') > -1) {
3121
- val = isArray(val) ? [val] : val;
3122
- }
3123
-
3124
- if (has.call(obj, key)) {
3125
- obj[key] = utils.combine(obj[key], val);
3126
- } else {
3127
- obj[key] = val;
3128
- }
3129
- }
3130
-
3131
- return obj;
3132
- };
3133
-
3134
- var parseObject = function (chain, val, options, valuesParsed) {
3135
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
3136
-
3137
- for (var i = chain.length - 1; i >= 0; --i) {
3138
- var obj;
3139
- var root = chain[i];
3140
-
3141
- if (root === '[]' && options.parseArrays) {
3142
- obj = [].concat(leaf);
3143
- } else {
3144
- obj = options.plainObjects ? Object.create(null) : {};
3145
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
3146
- var index = parseInt(cleanRoot, 10);
3147
- if (!options.parseArrays && cleanRoot === '') {
3148
- obj = { 0: leaf };
3149
- } else if (
3150
- !isNaN(index)
3151
- && root !== cleanRoot
3152
- && String(index) === cleanRoot
3153
- && index >= 0
3154
- && (options.parseArrays && index <= options.arrayLimit)
3155
- ) {
3156
- obj = [];
3157
- obj[index] = leaf;
3158
- } else if (cleanRoot !== '__proto__') {
3159
- obj[cleanRoot] = leaf;
3160
- }
3161
- }
3162
-
3163
- leaf = obj;
1030
+ handleSubmit([dateTimeToString(begin), dateTimeToString(end)]);
1031
+ } else {
1032
+ handleSubmit([]);
3164
1033
  }
1034
+ };
1035
+ if (props.kind === KINDS.dateRange) {
1036
+ return /*#__PURE__*/React.createElement(DateRangePicker, _extends({}, fieldProps, {
1037
+ onChange: handleChange
1038
+ }));
1039
+ }
3165
1040
 
3166
- return leaf;
1041
+ //time_range
1042
+ return /*#__PURE__*/React.createElement(TimeRangePicker, _extends({}, fieldProps, {
1043
+ use12Hours: true,
1044
+ format: "h:mm A",
1045
+ onChange: handleChange
1046
+ }));
3167
1047
  };
3168
1048
 
3169
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
3170
- if (!givenKey) {
3171
- return;
3172
- }
3173
-
3174
- // Transform dot notation to bracket notation
3175
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
3176
-
3177
- // The regex chunks
3178
-
3179
- var brackets = /(\[[^[\]]*])/;
3180
- var child = /(\[[^[\]]*])/g;
3181
-
3182
- // Get the parent
3183
-
3184
- var segment = options.depth > 0 && brackets.exec(key);
3185
- var parent = segment ? key.slice(0, segment.index) : key;
3186
-
3187
- // Stash the parent if it exists
3188
-
3189
- var keys = [];
3190
- if (parent) {
3191
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
3192
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
3193
- if (!options.allowPrototypes) {
3194
- return;
3195
- }
3196
- }
3197
-
3198
- keys.push(parent);
3199
- }
3200
-
3201
- // Loop through children appending to the array until we hit depth
3202
-
3203
- var i = 0;
3204
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
3205
- i += 1;
3206
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
3207
- if (!options.allowPrototypes) {
3208
- return;
3209
- }
3210
- }
3211
- keys.push(segment[1]);
3212
- }
3213
-
3214
- // If there's a remainder, just add whatever is left
3215
-
3216
- if (segment) {
3217
- keys.push('[' + key.slice(segment.index) + ']');
1049
+ var SingleOption = function SingleOption(props) {
1050
+ var _useFormikFields = useFormikFields(props),
1051
+ handleSubmit = _useFormikFields.handleSubmit,
1052
+ fieldProps = _useFormikFields.fieldProps;
1053
+ return /*#__PURE__*/React.createElement(Select$1, _extends({
1054
+ isClearable: true,
1055
+ isSearchable: true,
1056
+ strategy: "fixed"
1057
+ }, fieldProps, {
1058
+ onChange: function onChange(option) {
1059
+ return handleSubmit((option === null || option === void 0 ? void 0 : option.value) || "");
3218
1060
  }
3219
-
3220
- return parseObject(keys, val, options, valuesParsed);
1061
+ }));
3221
1062
  };
3222
1063
 
3223
- var normalizeParseOptions = function normalizeParseOptions(opts) {
3224
- if (!opts) {
3225
- return defaults;
3226
- }
3227
-
3228
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
3229
- throw new TypeError('Decoder has to be a function.');
3230
- }
3231
-
3232
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
3233
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
1064
+ var Text = function Text(props) {
1065
+ var _useFormikFields = useFormikFields(props),
1066
+ handleSubmit = _useFormikFields.handleSubmit,
1067
+ fieldProps = _useFormikFields.fieldProps,
1068
+ dirty = _useFormikFields.dirty;
1069
+ var individualSubmit = props.individualSubmit,
1070
+ isInline = props.isInline;
1071
+ var showSubmitButton = !isInline && individualSubmit && dirty;
1072
+ return /*#__PURE__*/React.createElement(Input, _extends({}, fieldProps, !isInline && {
1073
+ onBlur: function onBlur() {
1074
+ return handleSubmit();
3234
1075
  }
3235
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
3236
-
3237
- return {
3238
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
3239
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
3240
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
3241
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
3242
- charset: charset,
3243
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
3244
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
3245
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
3246
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
3247
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
3248
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
3249
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
3250
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
3251
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
3252
- parseArrays: opts.parseArrays !== false,
3253
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
3254
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
3255
- };
1076
+ }, {
1077
+ suffix: showSubmitButton && /*#__PURE__*/React.createElement(Button, {
1078
+ "data-cy": joinHyphenCase(fieldProps.label, "check-button"),
1079
+ icon: Check,
1080
+ style: "text",
1081
+ onClick: function onClick() {
1082
+ return handleSubmit();
1083
+ }
1084
+ })
1085
+ }));
3256
1086
  };
3257
1087
 
3258
- var parse$1 = function (str, opts) {
3259
- var options = normalizeParseOptions(opts);
3260
-
3261
- if (str === '' || str === null || typeof str === 'undefined') {
3262
- return options.plainObjects ? Object.create(null) : {};
3263
- }
3264
-
3265
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
3266
- var obj = options.plainObjects ? Object.create(null) : {};
3267
-
3268
- // Iterate over the keys and setup the new object
3269
-
3270
- var keys = Object.keys(tempObj);
3271
- for (var i = 0; i < keys.length; ++i) {
3272
- var key = keys[i];
3273
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
3274
- obj = utils.merge(obj, newObj, options);
3275
- }
3276
-
3277
- if (options.allowSparse === true) {
3278
- return obj;
1088
+ var TextArea = function TextArea(props) {
1089
+ var _useTranslation = useTranslation(),
1090
+ t = _useTranslation.t;
1091
+ var _useFormikFields = useFormikFields(props),
1092
+ handleSubmit = _useFormikFields.handleSubmit,
1093
+ fieldProps = _useFormikFields.fieldProps,
1094
+ dirty = _useFormikFields.dirty;
1095
+ var individualSubmit = props.individualSubmit,
1096
+ isInline = props.isInline;
1097
+ var showSubmitButton = !isInline && individualSubmit && dirty;
1098
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Textarea, fieldProps), showSubmitButton && /*#__PURE__*/React.createElement(Button, {
1099
+ className: "m-auto mt-2",
1100
+ label: t("neetoFields.labels.submit"),
1101
+ size: "small",
1102
+ onClick: function onClick() {
1103
+ return handleSubmit();
3279
1104
  }
3280
-
3281
- return utils.compact(obj);
1105
+ }));
3282
1106
  };
3283
1107
 
3284
- var stringify = stringify_1;
3285
- var parse = parse$1;
3286
- var formats = formats$3;
3287
-
3288
- var lib = {
3289
- formats: formats,
3290
- parse: parse,
3291
- stringify: stringify
1108
+ function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1109
+ function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1110
+ var standardComponents = {
1111
+ text: Text,
1112
+ regex: Text,
1113
+ textarea: TextArea,
1114
+ text_area: TextArea,
1115
+ // TODO: Remove text-area after integration in all hosts.
1116
+ number: Number$1,
1117
+ monetary: Number$1,
1118
+ integer: Number$1,
1119
+ decimal: Number$1,
1120
+ date: DateOrTime,
1121
+ time: DateOrTime,
1122
+ datetime: DateOrTime,
1123
+ single_option: SingleOption,
1124
+ multi_option: MultiOption,
1125
+ date_range: RangePicker,
1126
+ time_range: RangePicker,
1127
+ checkbox: Checkbox
1128
+ };
1129
+ var getFieldInput = function getFieldInput(_ref) {
1130
+ var field = _ref.field,
1131
+ _ref$customComponents = _ref.customComponents,
1132
+ customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents;
1133
+ var Component = customComponents[field.kind] || standardComponents[field.kind];
1134
+ if (Component) {
1135
+ return Component;
1136
+ }
1137
+ return null;
1138
+ };
1139
+ var removeItemsWithNullData = function removeItemsWithNullData(fieldValues) {
1140
+ return fieldValues.filter(function (item) {
1141
+ return !isNil(prop("data", item));
1142
+ });
1143
+ };
1144
+ var removeNoiseFromValues = function removeNoiseFromValues(fieldValues) {
1145
+ return map(pick(["id", "fieldId", "data"]), fieldValues);
1146
+ };
1147
+ var transformValues = function transformValues(_ref2) {
1148
+ var formikValues = _ref2.values,
1149
+ fields = _ref2.fields;
1150
+ var allFieldValues = clone(formikValues);
1151
+ var neetoFieldValues = [];
1152
+ fields.forEach(function (_ref3) {
1153
+ var id = _ref3.id,
1154
+ name = _ref3.name;
1155
+ var fieldPath = escapeString("".concat(name, "-").concat(id));
1156
+ neetoFieldValues.push(allFieldValues[fieldPath]);
1157
+ delete allFieldValues[fieldPath];
1158
+ });
1159
+ var cleanedFieldValues = pipe(removeItemsWithNullData, removeNoiseFromValues)(neetoFieldValues);
1160
+ return _objectSpread$f(_objectSpread$f({}, allFieldValues), {}, {
1161
+ fieldValuesAttributes: cleanedFieldValues
1162
+ });
1163
+ };
1164
+ var getDefaultInitialValue = function getDefaultInitialValue(kind) {
1165
+ switch (kind) {
1166
+ case KINDS.checkbox:
1167
+ return false;
1168
+ case KINDS.multiOption:
1169
+ case KINDS.dateRange:
1170
+ case KINDS.timeRange:
1171
+ return [];
1172
+ default:
1173
+ return "";
1174
+ }
1175
+ };
1176
+ var getInitialFieldValue = function getInitialFieldValue(_ref4) {
1177
+ var field = _ref4.field,
1178
+ _ref4$fieldValues = _ref4.fieldValues,
1179
+ fieldValues = _ref4$fieldValues === void 0 ? [] : _ref4$fieldValues,
1180
+ _ref4$isIndividualFie = _ref4.isIndividualFieldForm,
1181
+ isIndividualFieldForm = _ref4$isIndividualFie === void 0 ? false : _ref4$isIndividualFie;
1182
+ var existingFieldValueData = findBy({
1183
+ fieldId: field.id
1184
+ }, fieldValues);
1185
+ var keyInData = field.kind === KINDS.multiOption ? "values" : "value";
1186
+ var newFieldValueData = {
1187
+ fieldId: field.id,
1188
+ data: isIndividualFieldForm ? _defineProperty({}, keyInData, getDefaultInitialValue(field.kind)) : null
1189
+ };
1190
+ return _defineProperty({}, escapeString("".concat(field.name, "-").concat(field.id)), existingFieldValueData || newFieldValueData);
1191
+ };
1192
+ var getAllInitialFieldValues = function getAllInitialFieldValues(fields) {
1193
+ var fieldValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1194
+ return getNonSystemFields(fields).map(function (field) {
1195
+ return getInitialFieldValue({
1196
+ field: field,
1197
+ fieldValues: fieldValues
1198
+ });
1199
+ });
1200
+ };
1201
+ var mergeInitialValues = function mergeInitialValues(_ref7) {
1202
+ var initialValues = _ref7.initialValues,
1203
+ fields = _ref7.fields;
1204
+ var initialValue = mergeAll([initialValues].concat(_toConsumableArray(getAllInitialFieldValues(fields, initialValues === null || initialValues === void 0 ? void 0 : initialValues.fieldValues))));
1205
+ return omit(["fieldValues"], initialValue);
1206
+ };
1207
+ var getNonSystemFields = function getNonSystemFields(fields) {
1208
+ return filterBy({
1209
+ isSystem: false
1210
+ }, fields);
1211
+ };
1212
+ var escapeString = function escapeString(string) {
1213
+ return string.replace(/[^a-zA-Z0-9_]/g, function (match) {
1214
+ var charCode = match.charCodeAt(0);
1215
+ return "_".concat(charCode, "_");
1216
+ });
1217
+ };
1218
+ var neetoFieldsUtils = {
1219
+ mergeInitialValues: mergeInitialValues,
1220
+ transformValues: transformValues
3292
1221
  };
3293
1222
 
1223
+ function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1224
+ function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1225
+ var FieldInputs = withT(function (_ref) {
1226
+ var t = _ref.t,
1227
+ _ref$customComponents = _ref.customComponents,
1228
+ customComponents = _ref$customComponents === void 0 ? {} : _ref$customComponents,
1229
+ fields = _ref.fields,
1230
+ formRef = _ref.formRef,
1231
+ disabled = _ref.disabled,
1232
+ isRequiredColumnName = _ref.isRequiredColumnName;
1233
+ return getNonSystemFields(fields).map(function (field) {
1234
+ var Field = getFieldInput({
1235
+ field: field,
1236
+ customComponents: customComponents
1237
+ });
1238
+ if (Field) {
1239
+ return /*#__PURE__*/React.createElement(Field, _extends({
1240
+ key: field.id
1241
+ }, _objectSpread$e(_objectSpread$e({}, field), {}, {
1242
+ disabled: disabled,
1243
+ formRef: formRef,
1244
+ isRequiredColumnName: isRequiredColumnName
1245
+ })));
1246
+ }
1247
+ return /*#__PURE__*/React.createElement(Typography, {
1248
+ key: field.id,
1249
+ style: "body2"
1250
+ }, t("neetoFields.messages.invalidKind"));
1251
+ });
1252
+ });
1253
+
3294
1254
  var NEETO_FIELDS_URL = "/neeto_fields_engine/api/v1";
3295
1255
  var FIELDS_URL = "".concat(NEETO_FIELDS_URL, "/fields");
3296
1256
  var FIELD_VALUES_URL = "".concat(NEETO_FIELDS_URL, "/field_values");
@@ -3299,7 +1259,6 @@ var FIELD_URL = "".concat(NEETO_FIELDS_URL, "/fields/:fieldId");
3299
1259
  var DEPENDENCIES_URL = "".concat(NEETO_FIELDS_URL, "/fields/:fieldId/dependencies");
3300
1260
  var FIELDS_REORDER_URL = "".concat(FIELDS_URL, "/reorder");
3301
1261
  var CONFIGS_URL = "".concat(NEETO_FIELDS_URL, "/configs");
3302
- var INFO_ICON_SIZE = 16;
3303
1262
 
3304
1263
  function ownKeys$d(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3305
1264
  function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -3326,12 +1285,7 @@ var fetch$1 = function fetch(_ref) {
3326
1285
  ownerId: ownerId,
3327
1286
  state: state,
3328
1287
  filters: filters
3329
- }, pageProps),
3330
- paramsSerializer: function paramsSerializer(params) {
3331
- return lib.stringify(params, {
3332
- arrayFormat: "brackets"
3333
- });
3334
- }
1288
+ }, pageProps)
3335
1289
  });
3336
1290
  };
3337
1291
  var create$1 = function create(payload) {
@@ -5025,20 +2979,6 @@ var FieldsTable = function FieldsTable(_ref) {
5025
2979
  }));
5026
2980
  };
5027
2981
 
5028
- var TitleWithHelpLink = function TitleWithHelpLink(_ref) {
5029
- var title = _ref.title,
5030
- helpUrl = _ref.helpUrl;
5031
- return /*#__PURE__*/React.createElement("div", {
5032
- className: "flex items-center gap-x-1"
5033
- }, title, helpUrl && /*#__PURE__*/React.createElement("a", {
5034
- href: helpUrl,
5035
- rel: "noreferrer",
5036
- target: "_blank"
5037
- }, /*#__PURE__*/React.createElement(Info, {
5038
- size: INFO_ICON_SIZE
5039
- })));
5040
- };
5041
-
5042
2982
  // eslint-disable-next-line @bigbinary/neeto/no-dumb-components-with-use-translation
5043
2983
  var ActionBlock = function ActionBlock(_ref) {
5044
2984
  var reorderable = _ref.reorderable,
@@ -5065,24 +3005,29 @@ var ActionBlock = function ActionBlock(_ref) {
5065
3005
  }));
5066
3006
  };
5067
3007
 
5068
- var _excluded = ["searchInputProps", "breadcrumbs", "title", "helpDocUrl"];
5069
- var Header = function Header(_ref) {
3008
+ var _excluded = ["searchInputProps", "breadcrumbs", "title", "helpDocUrl", "helpDescription"];
3009
+ var Header = withT(function (_ref) {
5070
3010
  var searchInputProps = _ref.searchInputProps,
5071
3011
  breadcrumbs = _ref.breadcrumbs,
5072
3012
  title = _ref.title,
5073
3013
  helpDocUrl = _ref.helpDocUrl,
3014
+ helpDescription = _ref.helpDescription,
5074
3015
  actionBlockProps = _objectWithoutProperties(_ref, _excluded);
5075
3016
  return /*#__PURE__*/React.createElement(NeetoUIHeader, {
5076
3017
  breadcrumbs: breadcrumbs,
5077
3018
  actionBlock: /*#__PURE__*/React.createElement(ActionBlock, actionBlockProps),
5078
3019
  searchProps: searchInputProps,
5079
3020
  size: "small",
5080
- title: /*#__PURE__*/React.createElement(TitleWithHelpLink, {
3021
+ title: /*#__PURE__*/React.createElement("span", null, title, /*#__PURE__*/React.createElement(HelpPopover, {
5081
3022
  title: title,
5082
- helpUrl: helpDocUrl
5083
- })
3023
+ className: "ml-2 self-center",
3024
+ description: helpDescription,
3025
+ helpLinkProps: {
3026
+ href: helpDocUrl
3027
+ }
3028
+ }))
5084
3029
  });
5085
- };
3030
+ });
5086
3031
 
5087
3032
  var Menubar = function Menubar(_ref) {
5088
3033
  var menuBarItems = _ref.menuBarItems,
@@ -9511,6 +7456,7 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
9511
7456
  _ref$fieldStatesTaxon = _ref.fieldStatesTaxonomy,
9512
7457
  fieldStatesTaxonomy = _ref$fieldStatesTaxon === void 0 ? DEFAULT_FIELD_STATE_TAXONOMY : _ref$fieldStatesTaxon,
9513
7458
  helpDocUrl = _ref.helpDocUrl,
7459
+ helpDescription = _ref.helpDescription,
9514
7460
  _ref$nameAliases = _ref.nameAliases,
9515
7461
  nameAliases = _ref$nameAliases === void 0 ? {} : _ref$nameAliases,
9516
7462
  headerTitle = _ref.headerTitle,
@@ -9560,6 +7506,7 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
9560
7506
  reorderable: reorderable,
9561
7507
  breadcrumbs: breadcrumbs,
9562
7508
  helpDocUrl: helpDocUrl,
7509
+ helpDescription: helpDescription,
9563
7510
  searchInputProps: searchInputProps,
9564
7511
  setIsPaneOpen: setIsPaneOpen,
9565
7512
  setIsReorderPaneOpen: setIsReorderPaneOpen,
@@ -9576,6 +7523,7 @@ var FieldsDashboard = function FieldsDashboard(_ref) {
9576
7523
  className: "flex h-screen w-full flex-grow items-center justify-center"
9577
7524
  }, /*#__PURE__*/React.createElement(PageLoader, null)) : /*#__PURE__*/React.createElement(FieldsTable, {
9578
7525
  columnData: columnData,
7526
+ helpDescription: helpDescription,
9579
7527
  helpDocUrl: helpDocUrl,
9580
7528
  pageProps: pageProps,
9581
7529
  setIsPaneOpen: setIsPaneOpen,