1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4347],{34347:function(e,r,n){n.d(r,{gy:function(){return $}});var t,i=n(95235),a=n(82269),o=n(8529),l=n(52746),s=n(7328),d=n(59234),u=n(12190),c=n(54826),p=n(2984),g=n(66937),f=n(90523),v=n(73818),h=n(81890),m=n(2784),_=n(75545),y=function(e){return e%4===0&&e%100!==0||e%400===0},x={"Year,Month,Day,Hour,Minute":{example:"YYYY-MM-DD,HH:MM",regex:/^([1-9]\d{3})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]),(0\d|1\d|2[0-3]):([0-5]\d)$/,isValidDateValue:function(e){var r=(0,o.Z)(e,4),n=(r[0],+r[1]),t=+r[2];return+r[3]<=(2===t?y(n)?29:28:new Date(n,t,0).getDate())}},"Year,Month,Day":{example:"YYYY-MM-DD",regex:/^([1-9]\d{3})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,isValidDateValue:function(e){var r=(0,o.Z)(e,4),n=(r[0],+r[1]),t=+r[2];return+r[3]<=(2===t?y(n)?29:28:new Date(n,t,0).getDate())}},"Hour,Minute":{example:"HH:MM",regex:/^(0\d|1\d|2[0-3]):([0-5]\d)$/,isValidDateValue:function(){return!0}},"Month,Day,Hour,Minute":{example:"MM-DD,HH:MM",regex:/^(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]),(0\d|1\d|2[0-3]):([0-5]\d)$/,isValidDateValue:function(e){var r=(0,o.Z)(e,3),n=(r[0],+r[1]);return+r[2]<=(2===n?29:new Date(2024,n,0).getDate())}},"Day,Hour":{example:"DD,HH",regex:/^(0[1-9]|[12]\d|3[01]),(0\d|1\d|2[0-3])$/,isValidDateValue:function(){return!0}}},b=n(52322),D=["id","type"];function M(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function j(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?M(Object(n),!0).forEach((function(r){(0,i.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var E=_.default.label.withConfig({componentId:"sc-x3krb3-0"})(["",""],(function(e){var r=e.theme;return(0,_.css)(["display:block;color:",";margin-bottom:",";"],r.color.gray700,r.grid._1ako)})),I=_.default.div.withConfig({componentId:"sc-x3krb3-1"})(["",";"],(function(e){var r=e.theme;return(0,_.css)(["margin-bottom:",";"],r.grid._3ako)})),R=_.default.div.withConfig({componentId:"sc-x3krb3-2"})(["",";"],(function(e){var r=e.theme;return(0,_.css)(["margin:"," 0;"],r.grid._1ako)})),T=_.default.div.withConfig({componentId:"sc-x3krb3-3"})(["",";"],(function(e){var r=e.theme;return(0,_.css)(["margin-bottom:",";"],r.grid._1nko)})),V=_.default.div.withConfig({componentId:"sc-x3krb3-4"})(["",";"],(function(e){var r=e.theme;return(0,_.css)(["> span + span{margin-left:",";}",""],r.grid._2ako,r.device.lt.tablet(t||(t=(0,s.Z)(["\n span {\n display: flex;\n }\n > span + span {\n margin: "," 0 0;\n }\n "])),r.grid._2ako))})),O=RegExp(/^[a-z0-9.!#$%&\u2019*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i),A=RegExp(/^\d$/i),k=/^[0-9]{5,}$|^$/,C=/(^(0?)(10|70)([0-9]{4})([0-9]{4})$)|(^(0?)(2|3[1-3]|4[1-4]|5[1-5]|6[1-4])([0-9]{3,4})([0-9]{4})$)/,w=(0,f.O3)((function(e){var r=e.value,n=e.type,t=e.required,i=void 0!==t&&t,a=(0,u.mB)();if(n===c.AdditionalInfoFieldType.CHECK_BOX)return i&&0===r.length?{error:!0,message:a._("ERR_REQUIRED")}:{error:!1,message:""};if(i&&0===r.trim().length)return{error:!0,message:a._("ERR_REQUIRED")};if("string"===typeof r&&r.length>128){return{error:!0,message:a._({id:"QYq0BI",values:{limit:128}})}}var o=function(e){var r=(0,u.mB)();switch(e){case c.AdditionalInfoFieldType.EMAIL:return{regex:O,message:r._("ERR_INVALID_EMAIL")};case c.AdditionalInfoFieldType.INTEGER:return{regex:A,message:""}}}(n);if(o&&"string"===typeof r&&r.length>0&&!o.regex.test(r))return{error:!0,message:o.message};return{error:!1,message:""}})),F=(0,f.O3)((function(e){var r=e.countryNumber,n=e.phoneNumber,t=e.required,i=void 0!==t&&t,a=(0,u.mB)(),o="".concat(r).concat(n);if(i&&0===n.length)return{error:!0,message:a._("ERR_REQUIRED")};if(o.length>21){return{error:!0,message:a._({id:"QYq0BI",values:{limit:21}})}}return("+82"===r?C:k).test(n)?{error:!1,message:""}:{error:!0,message:a._({id:"BHSndl"})}})),H=(0,h.observer)((function(e){var r=e.id,n=e.title,t=e.type,i=e.description,a=e.value,o=e.onValidate,l=e.required,s=(0,m.useState)({_error:!1,_errorMessage:""}),u=s[0],p=s[1];return(0,b.jsx)(I,{children:(0,b.jsx)(d.TextField,{fluid:!0,size:"large",label:"".concat(n).concat(l?" *":""),defaultValue:a,name:n,type:t===c.AdditionalInfoFieldType.EMAIL?"email":"",placeholder:t===c.AdditionalInfoFieldType.DATE?"YYYY-MM-DD":"",onChange:function(e){var n=e.currentTarget.value,i=w({value:n.trim(),type:t,required:l}),a=i.error,s=i.message;o({id:r,value:n,isValid:!a}),p({_error:a,_errorMessage:s})},error:u._error,errorMessage:u._error?u._errorMessage:void 0,helperText:i||""})})})),Y=(0,h.observer)((function(e){var r=e.id,n=e.title,t=e.description,i=e.value,a=e.onValidate,o=e.required,s=e.options,c=void 0===s?[]:s,p=(0,m.useState)({_error:!1,_errorMessage:""}),g=p[0],f=p[1],h=(0,u.mB)(),_=["Year","Month","Day","Hour","Minute"],y=(0,l.Z)((0,v.toJS)(null!=c?c:[])).sort((function(e,r){return _.indexOf(e)-_.indexOf(r)})).join(","),D=x[y];return(0,b.jsx)(I,{children:(0,b.jsx)(d.TextField,{fluid:!0,size:"large",label:"".concat(n).concat(o?" *":""),defaultValue:i,name:n,placeholder:(null==D?void 0:D.example)||"",onChange:function(e){var n=e.currentTarget.value.trim(),t=!1,i="";if(o&&0===n.length)t=!0,i=h._("ERR_REQUIRED");else if(o||0!==n.length){var l=n.match(D.regex);l?D.isValidDateValue(l)||(t=!0,i=h._("ERR_INVALID_DATE")):(t=!0,i="".concat(h._({id:"BHSndl"})," ").concat(D.example))}else t=!1,i="";a({id:r,value:n,isValid:!t}),f({_error:t,_errorMessage:i})},error:g._error,errorMessage:g._error?g._errorMessage:void 0,helperText:t||""})})})),N=(0,h.observer)((function(e){var r=e.id,n=e.title,t=e.options,i=e.description,a=e.required,o=e.value,l=e.onValidate,s=(0,m.useMemo)((function(){return(null==t?void 0:t.map((function(e){return{label:e,value:e}})))||[]}),[t]),u=s.find((function(e){return e.value===o})),c=(0,m.useCallback)((function(e){var n=!(!e||null==t||!t.includes(e));l({isValid:n,id:r,value:e})}),[r,l,t]);return(0,b.jsxs)(I,{children:[(0,b.jsx)(E,{htmlFor:r,children:(0,b.jsx)(d.Typography,{variant:"fieldLabel",size:"small",children:n+(a?" *":"")}
1)}),(0,b.jsx)(d.Dropdown,{searchable:!0,size:"large",placeholder:n,value:u,items:s,onChange:function(e){return c(e.value)},helperText:i||""})]})})),B=(0,h.observer)((function(e){var r=e.id,n=e.title,t=e.options,i=void 0===t?[]:t,a=e.description,o=e.value,s=e.required,c=e.onValidate,p=(0,u.mB)(),g=(0,m.useState)("string"===typeof o&&o.length>0?o.split(","):[]),f=g[0],v=g[1],h=(0,m.useState)({_error:!1,_errorMessage:""}),_=h[0],y=h[1];return(0,b.jsxs)(I,{children:[(0,b.jsx)(E,{htmlFor:r,children:(0,b.jsx)(d.Typography,{variant:"fieldLabel",size:"small",children:n+(s?" *":"")})}),(0,b.jsxs)(V,{children:[null==i?void 0:i.map((function(e){return(0,b.jsx)(d.Checkbox,{error:_._error,label:(0,b.jsx)(d.Typography,{variant:"body",size:"small",children:e}),checked:f.includes(e),onChange:function(){return function(e){var n=f.includes(e)?f.filter((function(r){return r!==e})):[].concat((0,l.Z)(f),[e]),t=!s||n.length>0,i=t?"":p._("ERR_REQUIRED");v(n),y({_error:!t,_errorMessage:i}),c({id:r,value:n.join(","),isValid:t})}(e)}},e)})),_._error]}),(a||_._error)&&(0,b.jsxs)(R,{children:[_._error&&(0,b.jsx)(T,{children:(0,b.jsx)(d.Typography,{variant:"caption",size:"small",color:"error500",children:_._errorMessage})}),a&&(0,b.jsx)(d.Typography,{variant:"caption",size:"small",as:"p",color:"gray450",children:a})]})]})})),z=(0,h.observer)((function(e){var r=e.id,n=e.title,t=e.description,i=e.value,a=e.onValidate,l=e.required,s=(0,m.useState)({_error:!1,_errorMessage:""}),u=s[0],c=s[1],f=(0,m.useState)(""),v=f[0],h=f[1],_=(0,m.useMemo)((function(){var e="",r="";if(i){var n=i.split(","),t=(0,o.Z)(n,2);e=t[0],r=t[1];var a=(0,g.B_)(r,e),l="DO"===r||"PR"===r?"".concat(r,"_").concat((0,g.B_)(r,e).split("-")[1]):r;e=e.replace(a,""),r=l}return h(e),{phoneNumber:e,countryCode:r}}),[i]);return(0,b.jsxs)(I,{children:[(0,b.jsx)(p.no,{label:"".concat(n).concat(l?" *":""),initialValue:_,onChange:function(e){var n=e.countryCode,t=e.phoneNumber,i=(0,g.B_)(n),o=t.trim(),s=v.length>0||o.length>0?F({countryNumber:i,phoneNumber:o,required:l}):{error:!1,message:""},d=s.error,u=s.message;a({id:r,value:""!==o?"".concat(i).concat(o,",").concat(n.slice(0,2)):"",isValid:(!l||""!==o)&&!d}),c({_error:d,_errorMessage:u}),h(t)},phoneErrorMessage:u._error?u._errorMessage:void 0}),t&&(0,b.jsx)(R,{children:(0,b.jsx)(d.Typography,{variant:"caption",size:"small",as:"p",color:"gray450",children:t})})]})})),S=function(){return(0,b.jsx)("div",{children:"invalid field type"})},$=(0,h.observer)((function(e){var r=e.formFields,n=e.onValidate;return(0,b.jsx)(b.Fragment,{children:null==r?void 0:r.map((function(e){var r=e.id,t=e.type,i=(0,a.Z)(e,D),o=function(e){switch(e){case c.AdditionalInfoFieldType.STRING:case c.AdditionalInfoFieldType.EMAIL:case c.AdditionalInfoFieldType.INTEGER:return H;case c.AdditionalInfoFieldType.DATE:return Y;case c.AdditionalInfoFieldType.DROPDOWN:return N;case c.AdditionalInfoFieldType.PHONE:return z;case c.AdditionalInfoFieldType.CHECK_BOX:return B;default:return S}}(t);return(0,b.jsx)(o,j(j({id:r,type:t},i),{},{onValidate:n}),r)}))})}))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.