You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
10 KiB
1 lines
10 KiB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[336],{7504:function(n,e,t){var r=t(5893),u=t(7294),l=t(8263),o=t(7357);function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function a(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})))),r.forEach((function(e){a(n,e,t[e])}))}return n}function s(n,e){if(null==n)return{};var t,r,u=function(n,e){if(null==n)return{};var t,r,u={},l=Object.keys(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||(u[t]=n[t]);return u}(n,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(u[t]=n[t])}return u}function f(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var t=null==n?null:"undefined"!==typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,u,l=[],o=!0,i=!1;try{for(t=t.call(n);!(o=(r=t.next()).done)&&(l.push(r.value),!e||l.length!==e);o=!0);}catch(a){i=!0,u=a}finally{try{o||null==t.return||t.return()}finally{if(i)throw u}}return l}}(n,e)||function(n,e){if(!n)return;if("string"===typeof n)return i(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(n,e)}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.Z=function(n){var e=n.calculateItemBreakpoints,t=void 0===e?function(){return{xs:1}}:e,i=n.layout,a=n.wrapperBoxProps,v=s(n,["calculateItemBreakpoints","layout","wrapperBoxProps"]),d=(0,u.useMemo)((function(){return Object.entries(i).map((function(n,e){var r=f(n,2),o=r[0],i=r[1],a=o;return i?(0,u.createElement)(l.ZP,c({},t(e,a),{key:a,item:!0},i)):void 0}))}),[t,i]);return(0,r.jsx)(o.Z,c({},a,{children:(0,r.jsx)(l.ZP,c({container:!0},v,{children:d}))}))}},4069:function(n,e,t){t.d(e,{Z:function(){return g}});var r=t(7294),u=t(3675),l=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.postSet,t=n.preSet,r=n.set,l=n.setType,o=void 0===l?"string":l,i=n.valueKey,a=void 0===i?"value":i;return function(n){var l=n.target[a],i=u.Z[o](l);null===t||void 0===t||t.call(null,n),null===r||void 0===r||r.call(null,i),null===e||void 0===e||e.call(null,n)}},o=t(2027);function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function a(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})))),r.forEach((function(e){a(n,e,t[e])}))}return n}function s(n,e){if(null==n)return{};var t,r,u=function(n,e){if(null==n)return{};var t,r,u={},l=Object.keys(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||(u[t]=n[t]);return u}(n,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(u[t]=n[t])}return u}function f(n){return function(n){if(Array.isArray(n))return i(n)}(n)||function(n){if("undefined"!==typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(!n)return;if("string"===typeof n)return i(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(n,e)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(n){var e=function(n,e){if("object"!==d(n)||null===n)return n;var t=n[Symbol.toPrimitive];if(void 0!==t){var r=t.call(n,e||"default");if("object"!==d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(n)}(n,"string");return"symbol"===d(e)?e:String(e)}var d=function(n){return n&&"undefined"!==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n};var p="input",y={boolean:!1,number:0,string:""},b={createInputOnChangeHandlerOptions:{},required:!1,valueType:"string"},m=(0,r.forwardRef)((function(n,e){var t=n.input,u=n.inputTestBatch,i=n.onBlurAppend,d=n.onFirstRender,m=n.onFocusAppend,g=n.onUnmount,h=n.required,O=void 0===h?b.required:h,S=n.valueKey,j=n.valueType,w=void 0===j?b.valueType:j,k=n.createInputOnChangeHandlerOptions,C=void 0===k?b.createInputOnChangeHandlerOptions:k,A=C.postSet,I=C.valueKey,M=void 0===I?S:I,P=s(n.createInputOnChangeHandlerOptions,["postSet","valueKey"]),E=t.props,F=(0,r.useMemo)((function(){return null!==M&&void 0!==M?M:"checked"in E?"checked":"value"}),[E,M]),T=E.onBlur,x=E.onChange,B=E.onFocus,Z=E[F],R=void 0===Z?y[w]:Z,V=s(E,["onBlur","onChange","onFocus",F].map(v)),K=(0,r.useState)(R),U=K[0],q=K[1],H=(0,r.useState)(!1),N=H[0],_=H[1],$=(0,r.useState)(!1),D=$[0],L=$[1],W=(0,r.useCallback)((function(n){q(n)}),[]),z=(0,r.useMemo)((function(){var n;return u&&(u.isRequired=O,n=(0,o.LT)(a({},p,u))),n}),[u,O]),G=(0,r.useMemo)((function(){return null!==T&&void 0!==T?T:z&&function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var r,u=e[0],l=u.target.value,o=z({inputs:a({},p,{value:l})});L(o),null===i||void 0===i||(r=i).call.apply(r,[null].concat(f(e)))}}),[T,i,z]),J=(0,r.useMemo)((function(){return l(c({postSet:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var r,u;_(!0),null===x||void 0===x||(r=x).call.apply(r,[null].concat(f(e))),null===A||void 0===A||(u=A).call.apply(u,[null].concat(f(e)))},set:W,setType:w,valueKey:F},P))}),[x,A,P,W,F,w]),Q=(0,r.useMemo)((function(){return null!==B&&void 0!==B?B:u&&function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var r,l,o;null===(l=u.defaults)||void 0===l||null===(o=l.onSuccess)||void 0===o||o.call(null,{append:{}}),null===m||void 0===m||(r=m).call.apply(r,[null].concat(f(e)))}}),[B,u,m]);return(0,r.useEffect)((function(){var n,e=null!==(n=null===z||void 0===z?void 0:z.call(null,{inputs:a({},p,{value:U}),isIgnoreOnCallbacks:!0}))&&void 0!==n&&n;return null===d||void 0===d||d.call(null,{isValid:e}),g}),[]),(0,r.useImperativeHandle)(e,(function(){return{getIsChangedByUser:function(){return N},getValue:function(){return U},isValid:function(){return D},setValue:W}}),[U,N,D,W]),(0,r.cloneElement)(t,c({},V,a({onBlur:G,onChange:J,onFocus:Q,required:O},F,U)))}));m.defaultProps=b,m.displayName="InputWithRef";var g=m},8859:function(n,e,t){var r=t(7294),u=t(4390),l=t(6607),o=t(1770),i=t(2749);function a(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function c(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var t=null==n?null:"undefined"!==typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,u,l=[],o=!0,i=!1;try{for(t=t.call(n);!(o=(r=t.next()).done)&&(l.push(r.value),!e||l.length!==e);o=!0);}catch(a){i=!0,u=a}finally{try{o||null==t.return||t.return()}finally{if(i)throw u}}return l}}(n,e)||function(n,e){if(!n)return;if("string"===typeof n)return a(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(n,e)}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.Z=function(n,e){var t,a=c((0,i.Z)(!1),2),s=a[0],f=a[1],v=(0,r.useState)({}),d=v[0],p=v[1],y=(0,r.useCallback)((function(n){var t,r;return null===e||void 0===e||null===(t=e.current)||void 0===t||null===(r=t.setMessage)||void 0===r?void 0:r.call(null,"api",n)}),[e]),b=(0,r.useCallback)((function(n,t){var r,u;null===e||void 0===e||null===(r=e.current)||void 0===r||null===(u=r.setMessage)||void 0===u||u.call(null,String(n),t)}),[e]),m=(0,r.useCallback)((function(n,t){var r,u;null===e||void 0===e||null===(r=e.current)||void 0===r||null===(u=r.setMessageRe)||void 0===u||u.call(null,n,t)}),[e]),g=(0,r.useCallback)((function(n,e){p((0,l.ZP)(n,e))}),[]),h=(0,r.useCallback)((function(n,e){p((0,l.Um)(n,e))}),[]),O=(0,r.useCallback)((function(n){b(n),g(n)}),[b,g]),S=(0,r.useCallback)((function(n){m(n),h(n)}),[m,h]),j=(0,r.useCallback)((function(n){return function(e){g(n,e)}}),[g]),w=(0,r.useCallback)((function(n){return function(e){var t=e.isValid;g(n,t)}}),[g]),k=(0,r.useCallback)((function(n){return function(){O(n)}}),[O]),C=(0,r.useCallback)((function(n){var r=n.body,l=n.getErrorMsg,i=n.msgKey,a=void 0===i?"api":i,c=n.method,s=n.onError,v=n.onSuccess,d=n.setMsg,p=void 0===d?null===e||void 0===e||null===(t=e.current)||void 0===t?void 0:t.setMessage:d,y=n.successMsg,b=n.url;f(!0),u.Z.request({data:r,method:c,url:b}).then((function(){null===p||void 0===p||p.call(null,a,{children:y,type:"info"}),null===v||void 0===v||v.call(null)})).catch((function(n){var e=(0,o.Z)(n);e.children=l(e.children),null===p||void 0===p||p.call(null,a,e),null===s||void 0===s||s.call(null)})).finally((function(){f(!1)}))}),[e,f]),A=(0,r.useMemo)((function(){return Object.values(d).some((function(n){return!n}))}),[d]);return{buildFinishInputTestBatchFunction:j,buildInputFirstRenderFunction:w,buildInputUnmountFunction:k,formValidity:d,isFormInvalid:A,isFormSubmitting:s,setApiMessage:y,setFormValidity:p,setMessage:b,setMessageRe:m,setValidity:g,setValidityRe:h,submitForm:C,unsetKey:O,unsetKeyRe:S}}}}]); |