(window.webpackJsonpvtex_store_form_0_10_1=window.webpackJsonpvtex_store_form_0_10_1||[]).push([["Form"],[function(e,n){e.exports=React},,function(e,n){e.exports=ReactIntl},,,,,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.native-types@0.x/IOMessage"]},,,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Input"]},,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Alert"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Checkbox"]},function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return u}));var r=t(0),a={loading:!1,userInputError:null,serverError:null,success:null};function i(e,n){switch(n.type){case"SET_LOADING":return{loading:!0,userInputError:null,serverError:null,success:null};case"SET_SUCCESS":return{loading:!1,userInputError:!1,serverError:null,success:!0};case"SET_USER_INPUT_ERROR":return Object.assign(Object.assign({},e),{loading:!1,userInputError:!0,success:!1});case"SET_SERVER_INTERNAL_ERROR":return Object.assign(Object.assign({},e),{loading:!1,serverError:!0,success:!1});default:return e}}var o=function(){return Object(r.useReducer)(i,a)},u=t.n(r).a.createContext(a)},,function(e,n){e.exports=ReactApollo},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Textarea"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/RadioGroup"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Dropdown"]},,,,,,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},function(e,n,t){"use strict";t.r(n),t.d(n,"default",(function(){return b}));var r=t(0),a=t.n(r),i=t(2),o=t(13),u=t.n(o),c=t(12),s=t.n(c),d=t(26),m=t.n(d),l=t(7),f=t.n(l),v=t(15),p=["formSubmitContainer","formSubmitButton","formErrorServer","formErrorUserInput"],E=Object(i.defineMessages)({submitButton:{id:"store/form.submit.buttonLabel"},userInputError:{id:"store/form.submit.error.userInputError"},serverError:{id:"store/form.submit.error.serverError"}});function b(e){var n=e.label,t=void 0===n?E.submitButton.id:n,i=Object(r.useContext)(v.a),o=i.loading,c=i.userInputError,d=i.serverError,l=m()(p);return a.a.createElement("div",{className:l.formSubmitContainer},a.a.createElement("div",{className:l.formSubmitButton},a.a.createElement(u.a,{type:"submit",isLoading:o},a.a.createElement(f.a,{id:t}))),a.a.createElement("div",{className:l.formErrorUserInput},c&&a.a.createElement(s.a,{type:"error"},a.a.createElement(f.a,{id:E.userInputError.id}))),a.a.createElement("div",{className:l.formErrorServer},d&&a.a.createElement(s.a,{type:"error"},a.a.createElement(f.a,{id:E.serverError.id}))))}},,,function(e,n){e.exports=regeneratorRuntime},function(e,n){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getPublicSchema"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"schema"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.store-form@0.10.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documentPublicSchema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"dataEntity"},value:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}}},{kind:"Argument",name:{kind:"Name",value:"schema"},value:{kind:"Variable",name:{kind:"Name",value:"schema"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.store-graphql",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"f3722824087d2db9766a00227bb44916dfa425060002028aba80d740d8bb31fe",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:334}};t.loc.source={body:'query getPublicSchema($dataEntity: String!, $schema: String!) @context(sender: "vtex.store-form@0.10.1") {\n documentPublicSchema(dataEntity: $dataEntity, schema: $schema) @context(provider: "vtex.store-graphql") @runtimeMeta(hash: "f3722824087d2db9766a00227bb44916dfa425060002028aba80d740d8bb31fe") {\n schema\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var r={};function a(e,n){for(var t=0;t0;){var c=u;u=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(r[e]||new Set).forEach((function(e){u.add(e)})))}))}return o.forEach((function(n){var r=a(e,n);r&&t.definitions.push(r)})),t}(t,"getPublicSchema")},function(e,n){e.exports=__RENDER_8_RUNTIME__},function(e,n){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"document"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentInputV2"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"schema"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.store-form@0.10.1",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"9a7fad14a6c8d79d3df1d4064732f32b732d3379365246f93502e86f26628f2f",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDocumentV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"dataEntity"},value:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}}},{kind:"Argument",name:{kind:"Name",value:"document"},value:{kind:"Variable",name:{kind:"Name",value:"document"}}},{kind:"Argument",name:{kind:"Name",value:"schema"},value:{kind:"Variable",name:{kind:"Name",value:"schema"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.store-graphql",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"documentId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:412}};t.loc.source={body:'mutation createDocument($dataEntity: String!, $document: DocumentInputV2, $schema: String) @context(sender: "vtex.store-form@0.10.1") @runtimeMeta(hash: "9a7fad14a6c8d79d3df1d4064732f32b732d3379365246f93502e86f26628f2f") {\n createDocumentV2(dataEntity: $dataEntity, document: $document, schema: $schema) @context(provider: "vtex.store-graphql") {\n cacheId\n id\n href\n documentId\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var r={};function a(e,n){for(var t=0;t0;){var c=u;u=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(r[e]||new Set).forEach((function(e){u.add(e)})))}))}return o.forEach((function(n){var r=a(e,n);r&&t.definitions.push(r)})),t}(t,"createDocument")},,,,,,,,,function(e,n,t){"use strict";t.r(n),function(e){var n=t(3);t.p=Object(n.getPublicPath)("vtex.store-form@0.10.1");var r=Object(n.register)((function(){return t(62)}),e,"vtex.store-form@0.10.1","vtex.store-form@0.x","Form");r.renderHotReload,r.setupHMR}.call(this,t(9)(e))},,,,,,,,,,,,,,,,,,,,function(e,n,t){"use strict";t.r(n);var r=t(0),a=t.n(r),i=t(17),o=t(2),u=t(12),c=t.n(u),s=t(28),d=t(27),m=t(31),l=t.n(m),f=t(21),v=t.n(f),p=t(29),E=t(8),b=t(1),k=t(32),h=t(33),g=t.n(h),S=function(e,n){return"".concat(e,"/").concat(n)},N=function(e,n){return n.errors?e.concat(n.errors):e},y=function(e,n){var t,r,a,i;return(null===(i=null===(a=null===(r=null===(t=null==n?void 0:n.extensions)||void 0===t?void 0:t.exception)||void 0===r?void 0:r.response)||void 0===a?void 0:a.data)||void 0===i?void 0:i.errors)?e.concat(n.extensions.exception.response.data.errors.reduce(N,[])):e},_=function(e,n,t){e[n]?e[n].push(t):e[n]=[t]},x=function(e,n){var t=S(S(e.schemaId,"properties"),n);return _(e.nodes,t,b.b.required),{nodes:e.nodes,schemaId:e.schemaId}},O=function(e,n){switch(n.ErrorType){case"required":Array.isArray(n.Value)&&(e=n.Value.reduce(x,{nodes:e,schemaId:n.SchemaId}).nodes);break;case"format":case"type":_(e,n.SchemaId,b.b.pattern);break;case"maximum":_(e,n.SchemaId,b.b.maxValue);break;case"minimum":_(e,n.SchemaId,b.b.minValue);break;case"enum":_(e,n.SchemaId,b.b.notInEnum);break;case"minLength":_(e,n.SchemaId,b.b.minLength);break;case"maxLength":_(e,n.SchemaId,b.b.maxLength)}return e},R=t(15),D=function(e){var n=e.data,t=e.properties,r=Object.assign({},n);return Object.entries(t).forEach((function(e){var n,t=Object(E.a)(e,2),a=t[0];"date-time"===(null===(n=t[1])||void 0===n?void 0:n.format)&&r[a]&&(r[a]=new Date(r[a]).toISOString())})),r};function I(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"==typeof e)return T(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return T(e,n)}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return o=e.done,e},e:function(e){u=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(u)throw i}}}}function T(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t