(window["webpackJsonpform-app"]=window["webpackJsonpform-app"]||[]).push([[0],{36:function(e){e.exports=JSON.parse('{"action":{"start":["Let\'s Start!","Los Gehts!","On y va!"],"next":["Next","Weiter","Prochaine"],"back":["Back","Zur\xfcck","Retour"],"save":["Save","Speichern","Enregistrer"],"add":["Add","Hinzuf\xfcgen","Ajouter"],"switch":["Switch","Wechseln","Alterner"]},"general":{"hint":["Hint","Hinweis","Allusion"],"new":["New","Neu","Nouveau"],"changes":["Changes","\xc4nderungen","Modifications"],"choose":["Choose","Ausw\xe4hlen","Choisir"],"chooseSeller":["Choose Seller","Verk\xe4ufer Ausw\xe4hlen","Choisir le vendeur"],"chooseBuyer":["Choose Buyer","K\xe4ufer Ausw\xe4hlen","Choisir l\'acheteur"],"optional":["Optional","Optional","Facultatif"],"excl":["excl.","exkl.","ex."],"VAT":["VAT","MWST","T.V.A."],"step":["Step","Schritt","Pas"]},"state":{"regNum":["UID-Number","UID-Nummer","UID Num\xe9ro"]},"steps":{"legalForm":{"label":{"legalForm":["Legal Form","Gesellschaftsform","Forme Juridique de la Soci\xe9t\xe9"]},"defaultOption":["Choose the legal from","W\xe4hlen Sie Ihre Rechtsform","Choisissez votre forme juridique"],"options":{"AG":["Public Limited Company (PLC)","Aktiengesellschaft (AG)","Soci\xe9t\xe9 Anonyme (SA)"],"GmbH":["Limited Liability Company (LLC)","Gesellschaft mit beschr\xe4nkter Haftung","Soci\xe9t\xe9 \xe0 Responsabilit\xe9 Limit\xe9e (SARL)"],"EF":["Sole Proprietorship","Einzelfirma","Entreprise Individuelle"],"KLG":["Collective Partnership","Kollektivgesellschaft","Soci\xe9t\xe9 en Nom Collectif"]},"tooltip":{"CompanyName":["Company Name","Firmenname","Raison Sociale"],"regNum":["The UID is the unique identification number of your company and has the format \u201eCHE-123.456.789\u201c.","Die UID ist die eindeutige Identifikationsnummer Ihres Unternehmens und hat das Format \u201eCHE-123.456.789\u201c","L\'UID est le num\xe9ro d\'identification unique de votre entreprise et a le format \u201eCHE-123.456.789\u201c."]}},"selectMutation":{"question":["What would you like to change?","Was m\xf6chten Sie \xe4ndern?","Qu\'aimeriez-vous changer ?"],"types":{"CompanyName":["Company Name","Firmenname","Raison Sociale"],"Address":["Company Address","Firmenadresse","Adresse de la Soci\xe9t\xe9"],"HeadOffice":["Head Office","Firmensitz","Si\xe8ge Social"],"Purpose":["Purpose of the Company","Firmenzweck","Object Social"],"Person":["Person Change","Personen\xe4nderung","Changement de Personne"],"Transfer":["Transfer of Capital Participation","Stammanteil\xfcbertragung","Ceder des Parts Sociales"],"Capital":["Capital Increase","Kapitalerh\xf6hung","Augmentation du Capital"],"OptOut":["Opting-Out","Opting-Out","Opting-Out"],"OptIn":["Opting-In","Opting-In","Opting-In"]},"tooltip":{"CompanyName":["Company Name","Firmenname","Raison Sociale"],"Address":["Company Address","Firmenadresse","Adresse de la Soci\xe9t\xe9"],"HeadOffice":["Head Office","Firmensitz","Si\xe8ge Social"],"Purpose":["Purpose of the Company","Firmenzweck","Object Social"],"Person":["Person Change","Personen\xe4nderung","Changement de Personne"],"Transfer":["Transfer of Capital Participation","Stammanteil\xfcbertragung","Ceder des Parts Sociales"],"Capital":["Capital Increase","Kapitalerh\xf6hung","Augmentation du Capital"],"OptOut":["Opting-Out","Opting-Out","Opting-Out"],"OptIn":["Opting-In","Opting-In","Opting-In"]},"hint":["","W\xe4hlen Sie die gew\xfcnschten Mutationen aus. Wenn Sie mehrere Anpassung vornehmen m\xf6chten, f\xe4llt nur der h\xf6chste Preis an. Lediglich der Preis f\xfcr Stammanteils\xfcbertragungen f\xe4llt zus\xe4tzlich an, da diese f\xfcr uns einen Mehraufwand bedeutet.",""]},"newCompanyName":{"header":["Please enter the desired new company name.","Bitte geben Sie den gew\xfcnschten neuen Firmenname an.","Veuillez entrer le nouveau nom de l\'entreprise d\xe9sir\xe9e."],"label":["New Company Name","Neuer Firmenname","Nouveau nom d\'entreprise"]},"newCompanyPurpose":{"header":["Please enter the desired new purpose of the company.","Bitte geben Sie den gew\xfcnschten neuen Firmenzweck an.","Veuillez entrer le nouveau object social."],"label":["New Company Purpose","Neuer Firmenzweck","Nouveau Object Social"]},"newCompanyAddress":{"header":["Please enter the new address.","Bitte geben Sie die neue Adresse an.","Veuillez entrer la nouvelle adresse."],"onlyAddress":["You have selected the change of company address. Please note that you can only request a change within the same municipality without having to make any statutory changes. If you change the municipality, please switch to the company head office adjustment.","Sie haben die \xc4nderung der Firmenadresse ausgew\xe4hlt. Bitte beachten Sie, dass Sie lediglich eine \xc4nderung innerhalb der selben Gemeinde beantragen k\xf6nnen, ohne dass eine statutarische Anpassung notwendig ist. Falls Sie die Gemeinde wechseln, wechseln Sie bitte zur Firmensitzanpassung.","Vous avez s\xe9lectionn\xe9 le changement d\'adresse de l\'entreprise. Veuillez noter que vous ne pouvez demander un changement qu\'\xe0 l\'int\xe9rieur d\'une m\xeame municipalit\xe9 sans avoir \xe0 apporter de changements l\xe9gislatifs. Si vous changez de commune, veuillez passer \xe0 l\'adaptation du si\xe8ge social de la soci\xe9t\xe9."],"label":{"street":["Street","Strasse","Rue"],"zip":["Postal Code","Postleitzahl","Code Postal"],"city":["City","Stadt/Ort","Ville"]}},"people":{"header":["Enter persons","Personen erfassen","Saisir les personnes"],"hint":["Please enter all persons who are affected by a change.","Bitte erfassen Sie alle Personen, welche durch eine \xc4nderung betroffen sind.","Veuillez saisir toutes les personnes concern\xe9es par un changement."],"modal":{"header":["Edit person","Person bearbeiten","Modifier la personne"]},"label":{"type":["Type","Art","Mode"],"state":["State","Status","Statut"],"title":["Title","Anrede","Appel"]},"gender":{"male":["Mr.","Herr","M."],"female":["Mrs./Ms.","Frau","Mme"]},"state":{"current":["Current","Bisher","Courant"],"new":["New","Eintritt","Entr\xe9e"],"exit":["Exit","Austritt","Retrait"]},"type":{"person":["Individual","Nat\xfcrliche Person","Personne Physique"],"company":["Company","Unternehmen","Entreprise"]}},"peopleTransfer":{"header":["Transfer of Capital Participation","Stammanteil\xfcbertragung","Ceder des Parts Sociales"],"notEnough":["Not enough persons recorded, for a share transfer at least 2 persons are required.","Nicht gen\xfcgend Personen erfasst, f\xfcr eine Stammanteil\xfcbertragung werden mindestens 2 Personen ben\xf6tigt.","Pas assez de personnes enregistr\xe9es, pour un transfert d\'actions au moins 2 personnes sont n\xe9cessaires."],"edit":["Edit Transfer","Transfer bearbeiten","Traiter transfert"],"seller":["Seller","Verk\xe4ufer","Vendeur"],"shares":["Number of Shares","Anzahl Anteile","Nombre d\'actions"],"price":["Price","Preis total","Prix total"],"buyer":["Buyer","K\xe4ufer","Acheteur"],"sells":["sells","verkauft","vend"],"shares2":["shares","Anteile","actions"],"to":["to","an","\xe0"],"for":["for","f\xfcr","pour"],"modalHeader":["Add Person","Person hinzuf\xfcgen","Ajouter une personne"]},"contactDetails":{"header":["Contact Details","Kontaktdaten","Coordonn\xe9es"],"firstName":["Firstname","Vorname","Pr\xe9nom"],"lastName":["Lastname","Nachname","Nom de Famille"],"street":["Street","Strasse","Rue"],"zip":["Postal Code","Postleitzahl","Code Postal"],"city":["City","Stadt/Ort","Ville"],"email":["E-Mail","E-Mail","E-Mail"],"mobile":["Mobile","Tel.","T\xe9l\xe9phone"],"title":["Title","Anrede","Appel"],"agb":["I accept the terms and conditions","Ich akzeptiere die AGB","J\'accept les conditions g\xe9n\xe9rales de vente (CGV)"]},"overview":{"header":["Order Overview","Bestell\xfcbersicht","Aper\xe7u de Commande"]},"success":{"text":["Request successfully sent. We will contact you as soon as possible.","Anfrage erfolgreich gesendet. Wir werden so schnell wie m\xf6glich mit Ihnen Kontakt aufnehmen.","Demande envoy\xe9e avec succ\xe8s. Nous vous contacterons d\xe8s que possible."]}}}')},38:function(e,t,a){e.exports=a(88)},43:function(e,t,a){},85:function(e,t,a){},88:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(9),c=a.n(l),s=(a(43),a(4)),o=a.n(s),i=a(5),m=a(3),u=a(29),d=a.n(u);function p(e){var t=e.children;return r.a.createElement("div",{className:"BasicLayout"},r.a.createElement("div",{className:"BasicLayout__content"},t))}var f,E,b,h,v,g=a(2),N=a(6);function y(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SET_MUTATIONS,mutations:e});case 1:case"end":return a.stop()}}))}}function C(){return function(e){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:e({type:f.NEXT_STEP});case 1:case"end":return t.stop()}}))}}!function(e){e.NEXT_STEP="NEXT_STEP",e.SET_STEP="SET_STEP",e.SET_PRICES="SET_PRICES",e.SET_LEGAL_FORM="SET_LEGAL_FORM",e.SET_MUTATIONS="SET_MUTATIONS",e.SET_CONTACT_DETAILS="SET_CONTACT_DETAILS",e.SET_NEW_ADDRESS="SET_NEW_ADDRESS",e.SET_NEW_HEADQUARTER_ADDRESS="SET_NEW_HEADQUARTER_ADDRESS",e.SAVE_PERSON="SAVE_PERSON",e.DELETE_PERSON="DELETE_PERSON",e.SAVE_PEOPLE_TRANSFER="SAVE_PEOPLE_TRANSFER",e.DELETE_PEOPLE_TRANSFER="DELETE_PEOPLE_TRANSFER",e.SET_COMPANY="SET_COMPANY",e.SET_PURPOSE="SET_PURPOSE",e.SET_NEW_COMPANY="SET_NEW_COMPANY",e.SET_REG_NUM="SET_REG_NUM"}(f||(f={})),(b=E||(E={})).AG="AG",b.GmbH="GmbH",b.EF="EF",b.KLG="KLG",b.NotSet="NotSet",function(e){e.newCompanyName="newCompanyName",e.newCompanyPurpose="newCompanyPurpose",e.newAddress="newAddress",e.newHeadOffice="newHeadOffice",e.people="people",e.peopleTransfer="peopleTransfer",e.valuePerShare="valuePerShare",e.totalShares="totalShares"}(h||(h={})),function(e){e.CompanyName="CompanyName",e.Address="Address",e.HeadOffice="HeadOffice",e.Purpose="Purpose",e.Person="Person",e.Transfer="Transfer"}(v||(v={}));var O=a(30);function _(e,t){var a=Object(n.useState)(t||{}),r=Object(i.a)(a,2),l=r[0],c=r[1];Object(n.useEffect)((function(){t&&!Object(O.isEqual)(t,l)&&c(t)}),[]);return{handleChange:function(e){if(e.target.name){var t=e.target.name,a=e.target;"value"in e.target&&(e.persist(),c((function(e){return Object(m.a)({},e,Object(g.a)({},t,a.value))})))}},handleSubmit:function(t){t&&t.preventDefault(),e()},values:l}}function w(e){var t=e.title,a=void 0===t?"Click":t,n=e.disabled,l=void 0!==n&&n,c=e.onClick,s=void 0===c?function(){}:c,o=e.submit,i=void 0!==o&&o,m=e.style,u=void 0===m?{}:m,d=e.type,p=void 0===d?"primary":d,f=e.className,E=void 0===f?"":f,b=e.block,h=void 0!==b&&b,v=e.ref,g=["Button","Button--".concat(p),E];return h&&g.push("Button--block"),r.a.createElement("button",{disabled:l,type:i?"submit":"button",onClick:s,className:g.join(" "),style:u,ref:v},a)}var S=a(1);function j(e){var t=e.onChange,a=e.value,n=e.name,l=e.error,c=e.displayName,s=e.required,o=e.className,i=e.placeholder,m=e.tooltip,u=e.autoFocus,d=l?"input text-input error":"input text-input";return r.a.createElement("div",{className:o?"".concat(d," ").concat(o):d,"data-tip":m},r.a.createElement("label",null,c),r.a.createElement("input",{autoFocus:u,name:n,value:a,onChange:t,required:s,placeholder:i}))}function P(e){var t=e.onChange,a=e.value,n=e.name,l=e.displayName,c=e.required,s=e.className,o=e.cols,i=e.rows,m=e.maxLength;return r.a.createElement("div",{className:s?"input textarea-input ".concat(s):"input textarea-input"},r.a.createElement("label",null,l),r.a.createElement("textarea",{name:n,value:a,onChange:t,required:c,cols:o,rows:i,maxLength:m}))}function T(e){var t=e.onChange,a=e.value,n=e.name,l=e.displayName,c=e.required,s=e.error,o=e.className,i=e.placeholder,m=s?"input number-input error":"input number-input";return r.a.createElement("div",{className:o?"".concat(m," ").concat(o):m},r.a.createElement("label",null,l),r.a.createElement("input",{type:"number",name:n,placeholder:i,value:a,onChange:t,required:c}))}var A=a(37),k={singleValue:function(e){return Object(m.a)({},e,{color:"#004350"})},control:function(e){return Object(m.a)({},e,{borderStyle:"unset",borderRadius:"0px !important"})},container:function(e){return Object(m.a)({},e,{border:"1px solid #004350",marginTop:"2px",marginRight:"10px",fontSize:"100%",width:"100%",minHeight:"32px",marginBottom:"5px",textAlignLast:"center",fontWeight:"bold",textTransform:"uppercase",color:"#004350",borderRadius:"0px",letterSpacing:"-0.03em",backgroundColor:"#fff",fontFamily:"font-family: 'Ebrima',Helvetica,Arial,Lucida,sans-serif"})},option:function(e,t){var a=t.data;return Object(m.a)({},e,{fontFamily:"font-family: 'Ebrima',Helvetica,Arial,Lucida,sans-serif",backgroundColor:-1===a.value&&"#fa003b",color:-1===a.value?"white":"#004350",textAlign:-1===a.value?"center":"left",alignSelf:-1===a.value?"center":"left",fontSize:-1===a.value&&"150%"})},menuList:function(e){return Object(m.a)({},e,{border:"1px solid #004350"})}};function F(e){var t=e.onChange,a=e.options,n=e.value,l=e.error,c=e.name,s=e.displayName,o=e.disabled,i=e.required,m=e.placeholder,u=l?"input select-input error":"input select-input",d=a.find((function(e){return Number.isInteger(parseInt(n.toString(),10))?parseInt(e.value.toString(),10)===parseInt(n.toString(),10):e.value===n}));return r.a.createElement(S.b,null,(function(e){var l=e.translate;return r.a.createElement("div",{className:u},r.a.createElement("label",null,s),r.a.createElement(A.a,{styles:k,placeholder:m,value:{value:n,label:d?d.translate?l(d.displayName):d.displayName:""},onChange:function(e){var a=e.value;t({persist:function(){},target:{name:c,value:a}})},options:a.map((function(e){return{value:e.value,label:-1===e.value?"+ ".concat(e.translate?l(e.displayName):e.displayName):e.translate?l(e.displayName):e.displayName}})),required:i,isDisabled:o}))}))}var x,M,I,D,R,L,H,z,G,q,W=function(e){var t=e.value,a=e.onChange,n=e.name,l=e.id,c=e.tooltip,s=e.error,o=e.displayName;return r.a.createElement("div",{className:"input-checkbox","data-tip":c},r.a.createElement("input",{name:n,checked:t,onChange:a,className:"input-checkbox__checkbox",id:l,type:"checkbox"}),r.a.createElement("label",{className:"input-checkbox__label",htmlFor:l,style:{backgroundColor:t?"#fa003b":""}},r.a.createElement("span",{className:"input-checkbox__button"})),o&&r.a.createElement("label",{className:s?"error":"",htmlFor:l},o))},B=a(11),V=a.n(B);var U=(R={},Object(g.a)(R,E.AG,(x={},Object(g.a)(x,v.CompanyName,[h.newCompanyName]),Object(g.a)(x,v.Address,[h.newAddress]),Object(g.a)(x,v.HeadOffice,[h.newHeadOffice]),Object(g.a)(x,v.Purpose,[h.newCompanyPurpose]),Object(g.a)(x,v.Person,[h.valuePerShare,h.people]),x)),Object(g.a)(R,E.GmbH,(M={},Object(g.a)(M,v.CompanyName,[h.newCompanyName]),Object(g.a)(M,v.Address,[h.newAddress]),Object(g.a)(M,v.HeadOffice,[h.newHeadOffice]),Object(g.a)(M,v.Purpose,[h.newCompanyPurpose]),Object(g.a)(M,v.Person,[h.people]),Object(g.a)(M,v.Transfer,[h.peopleTransfer]),M)),Object(g.a)(R,E.EF,(I={},Object(g.a)(I,v.CompanyName,[h.newCompanyName]),Object(g.a)(I,v.Address,[h.newAddress]),Object(g.a)(I,v.HeadOffice,[h.newHeadOffice]),Object(g.a)(I,v.Purpose,[h.newCompanyPurpose]),Object(g.a)(I,v.Person,[h.people]),I)),Object(g.a)(R,E.KLG,(D={},Object(g.a)(D,v.CompanyName,[h.newCompanyName]),Object(g.a)(D,v.Address,[h.newAddress]),Object(g.a)(D,v.HeadOffice,[h.newHeadOffice]),Object(g.a)(D,v.Purpose,[h.newCompanyPurpose]),Object(g.a)(D,v.Person,[h.people]),D)),R),K=(q={},Object(g.a)(q,E.NotSet,{}),Object(g.a)(q,E.AG,(L={},Object(g.a)(L,v.CompanyName,{stauteChange:!0,price:490}),Object(g.a)(L,v.Address,{stauteChange:!1,price:150}),Object(g.a)(L,v.HeadOffice,{stauteChange:!0,price:490}),Object(g.a)(L,v.Purpose,{stauteChange:!0,price:490}),Object(g.a)(L,v.Person,{stauteChange:!1,price:150}),L)),Object(g.a)(q,E.GmbH,(H={},Object(g.a)(H,v.CompanyName,{stauteChange:!0,price:490}),Object(g.a)(H,v.Address,{stauteChange:!1,price:150}),Object(g.a)(H,v.HeadOffice,{stauteChange:!0,price:490}),Object(g.a)(H,v.Purpose,{stauteChange:!0,price:490}),Object(g.a)(H,v.Person,{stauteChange:!1,price:150}),Object(g.a)(H,v.Transfer,{stauteChange:!1,price:245,additional:!0}),H)),Object(g.a)(q,E.EF,(z={},Object(g.a)(z,v.CompanyName,{stauteChange:!0,price:150}),Object(g.a)(z,v.Address,{stauteChange:!1,price:150}),Object(g.a)(z,v.HeadOffice,{stauteChange:!0,price:150}),Object(g.a)(z,v.Purpose,{stauteChange:!0,price:150}),Object(g.a)(z,v.Person,{stauteChange:!1,price:150}),z)),Object(g.a)(q,E.KLG,(G={},Object(g.a)(G,v.CompanyName,{stauteChange:!0,price:150}),Object(g.a)(G,v.Address,{stauteChange:!1,price:150}),Object(g.a)(G,v.HeadOffice,{stauteChange:!0,price:150}),Object(g.a)(G,v.Purpose,{stauteChange:!0,price:150}),Object(g.a)(G,v.Person,{stauteChange:!1,price:150}),G)),q);function Y(){var e=Object(n.useContext)(we),t=e.currentStep,a=e.legalForm,l=e.mutations,c=Object(n.useContext)(Se);return Object(n.useEffect)((function(){history.pushState(null,"",null),window.onpopstate=function(a){var n;if(1!==t)return history.pushState(null,"",null),c((n=function(e){for(var t=e.mutations,a=e.currentStep,n=e.legalForm,r=a-1;r>1;r--)if(J(r,n,t))return r;return 1}(e),function(e){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:e({type:f.SET_STEP,step:n});case 1:case"end":return t.stop()}}))}))}}),[t]),Object(n.useEffect)((function(){J(t,a,l)||c(C())})),r.a.createElement(r.a.Fragment,null,Ce[t-1].module)}function J(e,t,a){if(!Ce[e-1].fields)return!0;var n=Ce[e-1].fields;return a.map((function(e){return!!U[t]&&U[t][e].reduce((function(e,t){return e||n.includes(t)}),!1)})).reduce((function(e,t){return e||t}),!1)}function Q(e){var t=e.mutations.reduce((function(t,a){return e.prices[e.legalForm][a].additional?Object(m.a)({},t,{additional:t.additional+e.prices[e.legalForm][a].price}):Object(m.a)({},t,{price:Math.max(t.price,e.prices[e.legalForm][a].price)})}),{price:0,additional:0});return t.price+t.additional}function X(e){return Number.isInteger(e)?"CHF ".concat(Z(e.toFixed(0)),".\u2013"):"CHF ".concat(Z(e.toFixed(2)))}function Z(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,"'")}function $(e){var t=e.mutations,a=Object(n.useContext)(we),l=a.mutations,c=a.legalForm,s=a.prices,o=t||l;return r.a.createElement("div",{className:"PriceTable"},r.a.createElement("div",{className:"PriceTable__header"},r.a.createElement(S.b,{id:"general.changes"})," ",r.a.createElement(S.b,{id:"steps.legalForm.options.".concat(c)})),r.a.createElement("ul",{className:"PriceTable__mutations"},o.map((function(e){return r.a.createElement("li",{className:"PriceTable__mutation",key:e},r.a.createElement(S.b,{id:"steps.selectMutation.types.".concat(e)}))}))),r.a.createElement("div",{className:"PriceTable__total"},r.a.createElement("div",{className:"PriceTable__total__total"},"Total:"),r.a.createElement("div",{className:"PriceTable__total__price"},X(Q({mutations:o,legalForm:c,prices:s}))," ",r.a.createElement("div",{className:"PriceTable__total__extra"},r.a.createElement(S.b,{id:"general.excl"}),r.a.createElement(S.b,{id:"general.VAT"})))))}function ee(e){var t=e.transfer,a=Object(n.useContext)(we).people,l=ae(te(a,t.fromId)),c=ae(te(a,t.toId));return r.a.createElement("div",{className:"Transfer"},r.a.createElement("div",null,l)," ",r.a.createElement(S.b,{id:"steps.peopleTransfer.sells"})," ",r.a.createElement("div",{className:"shares",style:{fontWeight:"bold"}},Z(t.shares)," ",r.a.createElement(S.b,{id:"steps.peopleTransfer.shares2"}))," ",r.a.createElement(S.b,{id:"steps.peopleTransfer.to"}),r.a.createElement("br",null),r.a.createElement("div",null,c),"\xa0",r.a.createElement(S.b,{id:"steps.peopleTransfer.for"}),"\xa0",r.a.createElement("div",{className:"price",style:{fontWeight:"bold"}},X(parseFloat("".concat(t.price)))))}function te(e,t){return e.find((function(e){return e.id===t}))}function ae(e){return e?"person"===e.type?"".concat(e.firstName," ").concat(e.lastName):e.companyName:""}function ne(e){var t=e.open,a=e.onClose,n=e.title,l=e.children;return r.a.createElement("div",{style:{display:t?"block":"none"},className:"modal"},r.a.createElement("div",{className:"modal__content"},r.a.createElement("div",{className:"modal__header"},r.a.createElement("span",{onClick:a,className:"close"},"\xd7"),r.a.createElement("h2",null,n)),r.a.createElement("div",{className:"modal__body"},l)))}var re={id:0,type:"person",companyName:"",firstName:"",lastName:"",gender:"male",state:"current"};function le(e){var t=e.person,a=e.onSuccess,l=Object(n.useContext)(Se),c=_((function(){}),t||re),s=c.handleChange,i=c.values,m=Object(n.useCallback)((function(e){e.preventDefault(),e.stopPropagation();var t={id:i.id,state:i.state,type:i.type,firstName:"person"===i.type?i.firstName:"",lastName:"person"===i.type?i.lastName:"",gender:"person"===i.type?i.gender:"neutral",companyName:"company"===i.type?i.companyName:""};l(function(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SAVE_PERSON,person:e});case 1:case"end":return a.stop()}}))}}(t)),a(t)}),[i]);return r.a.createElement("div",{className:"EditPersonForm"},r.a.createElement(S.b,null,(function(e){var a=e.translate;return r.a.createElement("form",{onSubmit:m},r.a.createElement(F,{onChange:s,value:i.type,name:"type",displayName:a("steps.people.label.type"),options:[{id:1,value:"person",displayName:a("steps.people.type.person")},{id:2,value:"company",displayName:a("steps.people.type.company")}],required:!0}),"person"===i.type&&r.a.createElement(r.a.Fragment,null,r.a.createElement(F,{onChange:s,value:i.gender,name:"gender",displayName:a("steps.people.label.title"),options:[{id:1,value:"male",displayName:a("steps.people.gender.male")},{id:2,value:"female",displayName:a("steps.people.gender.female")}],required:!0}),r.a.createElement(j,{onChange:s,value:i.firstName,name:"firstName",displayName:a("steps.contactDetails.firstName"),required:!0}),r.a.createElement(j,{onChange:s,value:i.lastName,name:"lastName",displayName:a("steps.contactDetails.lastName"),required:!0})),"company"===i.type&&r.a.createElement(r.a.Fragment,null,r.a.createElement(j,{onChange:s,value:i.companyName,name:"companyName",displayName:a("steps.selectMutation.types.CompanyName"),required:!0})),r.a.createElement(F,{onChange:s,value:i.state,name:"state",displayName:a("steps.people.label.state"),options:[{id:1,value:"current",displayName:a("steps.people.state.current")},{id:2,value:"new",displayName:a("steps.people.state.new")},{id:3,value:"exit",displayName:a("steps.people.state.exit")}],required:!0}),r.a.createElement(w,{submit:!0,title:t?r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.save"}),r.a.createElement("i",{className:"far fa-save"})):r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.add"}),r.a.createElement("i",{className:"fas fa-user-plus"})),block:!0}))})))}function ce(e){var t=e.onEdit,a=e.onDelete,l=Object(n.useContext)(we).people,c=Object(n.useMemo)((function(){return r.a.createElement("div",{className:"PersonList"},l.map((function(e){return r.a.createElement(se,{person:e,onDelete:a,onEdit:t,key:e.id})})))}),[l,t,a]);return r.a.createElement("div",null,c)}function se(e){var t=e.person,a=e.onEdit,n=e.onDelete;return r.a.createElement("div",{className:"PersonList__row"},r.a.createElement(oe,{person:t}),r.a.createElement(me,{person:t,onDelete:n}),r.a.createElement(ie,{person:t,onEdit:a}))}function oe(e){var t=e.person;return r.a.createElement("div",null,ae(t)," (",r.a.createElement(S.b,{id:"steps.people.state.".concat(t.state)}),")")}function ie(e){var t=e.person,a=e.onEdit;return r.a.createElement(w,{type:"info",style:{backgroundColor:"#C4C4C4",color:"#4A4A4A",border:"none"},onClick:function(){a&&a(t)},title:r.a.createElement("i",{className:"fas fa-edit"})})}function me(e){var t=e.person,a=e.onDelete;return r.a.createElement(w,{type:"basic",style:{backgroundColor:"#D6D6D7",color:"#A2A2A2",border:"none"},onClick:function(){a&&a(t)},title:r.a.createElement("i",{className:"fas fa-trash"})})}function ue(e){var t=e.onEdit,a=e.onDelete,l=Object(n.useContext)(we).peopleTransfer,c=Object(n.useMemo)((function(){return r.a.createElement("div",null,l.map((function(e){return r.a.createElement("div",{className:"TransferListRow",key:e.id},r.a.createElement(ee,{transfer:e}),r.a.createElement("div",{className:"TransferListRow__buttons"},r.a.createElement(w,{style:{backgroundColor:"#C4C4C4",color:"#4A4A4A",border:"none",height:"100%"},onClick:t?function(){t(e)}:void 0,title:r.a.createElement("i",{className:"fas fa-edit"})}),r.a.createElement(w,{onClick:a?function(){a(e)}:void 0,style:{backgroundColor:"#D6D6D7",color:"#A2A2A2",border:"none",height:"100%"},title:r.a.createElement("i",{className:"fas fa-trash-alt"}),type:"danger"})))})))}),[t,a,l]);return r.a.createElement("div",null,c)}function de(e){var t=e.transfer,a=e.onSuccess,l=Object(n.useContext)(we).people,c=Object(n.useContext)(Se),s=Object(n.useState)({show:!1,operation:""}),u=Object(i.a)(s,2),d=u[0],p=u[1],E=_((function(){}),t||{fromId:0,toId:0,shares:1,price:0}),b=E.values,h=E.handleChange,v=Object(n.useMemo)((function(){return[{id:0,value:0,translate:!0,displayName:"general.chooseSeller"}].concat(Object(N.a)(l.filter((function(e){return e.id!==parseInt(b.toId.toString(),10)})).map((function(e){return{id:e.id,value:e.id,displayName:ae(e)}}))),[{id:-1,value:-1,translate:!0,displayName:"action.add"}])}),[b,l]),g=Object(n.useMemo)((function(){return[{id:0,value:0,translate:!0,displayName:"general.chooseBuyer"}].concat(Object(N.a)(l.filter((function(e){return e.id!==parseInt(b.fromId.toString(),10)})).map((function(e){return{id:e.id,value:e.id,displayName:ae(e)}}))),[{id:-1,value:-1,translate:!0,displayName:"action.add"}])}),[b,l]),y=Object(n.useMemo)((function(){return 0!==b.fromId?l.find((function(e){return e.id===parseInt(b.fromId.toString(),10)})):void 0}),[b,l]),C=Object(n.useCallback)((function(e){e.preventDefault(),e.stopPropagation(),c(function(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SAVE_PEOPLE_TRANSFER,transfer:Object(m.a)({id:e.id?e.id:Date.now()},e)});case 1:case"end":return a.stop()}}))}}(Object(m.a)({},b.id&&{id:parseInt(b.id.toString(),10)},{fromId:parseInt(b.fromId.toString(),10),toId:parseInt(b.toId.toString(),10),shares:parseInt(b.shares.toString(),10),price:parseFloat(b.price.toString())}))),a()}),[b]),O=Object(n.useCallback)((function(){h({target:{name:d.operation,value:(l.reduce((function(e,t){return e>t.id?e:t.id}),0)+1).toString()},persist:function(){}}),p({show:!1,operation:""})}),[d,h,l]),j=Object(n.useCallback)((function(){p({show:!1,operation:""}),h({target:{name:d.operation,value:"0"},persist:function(){}})}),[h,d]);return Object(n.useEffect)((function(){return-1===parseInt(b.fromId.toString(),10)?p({show:!0,operation:"fromId"}):-1===parseInt(b.toId.toString(),10)?p({show:!0,operation:"toId"}):void 0}),[b]),r.a.createElement("div",null,d.show&&r.a.createElement(ne,{open:d.show,onClose:j,title:r.a.createElement(S.b,{id:"steps.peopleTransfer.modalHeader"})},r.a.createElement(le,{onSuccess:O})),r.a.createElement("form",{onSubmit:C},r.a.createElement(F,{displayName:r.a.createElement(S.b,{id:"steps.peopleTransfer.seller"}),name:"fromId",onChange:h,value:b.fromId,options:v,required:!0}),y&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{marginTop:"40px",marginBottom:"40px"}},r.a.createElement(T,{min:1,step:1,displayName:r.a.createElement(S.b,{id:"steps.peopleTransfer.shares"}),name:"shares",onChange:h,value:b.shares,required:!0}),r.a.createElement(T,{min:1,step:.01,displayName:r.a.createElement(S.b,{id:"steps.peopleTransfer.price"}),name:"price",onChange:h,value:b.price,required:!0})),r.a.createElement(F,{displayName:r.a.createElement(S.b,{id:"steps.peopleTransfer.buyer"}),name:"toId",onChange:h,value:b.toId,options:g,required:!0})),parseInt(b.toId.toString(),10)>0&&parseInt(b.fromId.toString(),10)>0&&b.shares>0&&b.price>0&&r.a.createElement(w,{submit:!0,title:r.a.createElement(r.a.Fragment,null,t?r.a.createElement(S.b,{id:"action.save"}):r.a.createElement(S.b,{id:"action.add"})),block:!0})))}function pe(e){var t=e.name,a=e.price,n=e.displayName,l=e.checked,c=e.onChange;return r.a.createElement(S.b,null,(function(e){var s=e.translate;return r.a.createElement("div",{className:"MutationSelect__group","data-tip":s("steps.selectMutation.tooltip.".concat(t))},r.a.createElement(W,{id:"MutationSelect__".concat(t),value:l,onChange:c,name:t}),r.a.createElement("div",{className:"MutationSelect__group__label"},r.a.createElement("label",{htmlFor:"MutationSelect__".concat(t)},n),r.a.createElement("div",{className:"MutationSelect__Price"},X(a.price))),r.a.createElement(V.a,null))}))}function fe(e){var t=e.onChange,a=e.value,n=e.name,l=e.displayName,c=e.required,s=e.error,o=e.className,i=s?"input text-input error":"input text-input";return r.a.createElement("div",{className:o?"".concat(i," ").concat(o):i},r.a.createElement("label",null,l),r.a.createElement("input",{name:n,type:"mail",value:a,onChange:t,required:c}))}var Ee=a(34),be=a.n(Ee),he=a(12),ve=a.n(he);a(84);function ge(e){if(e.length<=3)return!0;return!!e.match(/^\+?([0-9]{2})\)?[-. ]?([0-9]{2})[-. ]?([0-9]{3})[-. ]?([0-9]{2})[-. ]?([0-9]{2})$/)}function Ne(e){return!!e.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)}var ye,Ce=[{module:r.a.createElement((function(){var e=Object(n.useContext)(Se),t=Object(n.useCallback)((function(){setTimeout((function(){window.scrollTo({behavior:"smooth",top:window.scrollY+300,left:0})}),500),e(C())}),[]);return r.a.createElement("div",{className:"mutation-step start"},r.a.createElement(S.b,null,(function(e){e.translate;return r.a.createElement(r.a.Fragment,null,r.a.createElement(w,{onClick:t,block:!0,title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.start"}),r.a.createElement("i",{className:"fas fa-chevron-right"}))}))})))}),null),name:"ChooseLegalForm"},{module:r.a.createElement((function(){var e=Object(n.useContext)(Se),t=Object(n.useContext)(we),a=_((function(){}),{legalForm:t.legalForm,companyName:t.companyName,regNum:t.regNum}),l=a.handleChange,c=a.values,s=Object(n.useMemo)((function(){return function(e){return e.legalForm.length>0&&e.legalForm!==E.NotSet&&e.companyName.length>0}(c)}),[c]),i=Object(n.useCallback)((function(){var t;s&&(e(function(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SET_COMPANY,companyName:e});case 1:case"end":return a.stop()}}))}}(c.companyName)),e(function(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SET_REG_NUM,regNum:e});case 1:case"end":return a.stop()}}))}}(c.regNum)),e((t=c.legalForm,function(e){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:e({type:f.SET_LEGAL_FORM,legalForm:t});case 1:case"end":return a.stop()}}))})),e(C()))}),[s,c]);return r.a.createElement("div",{className:"mutation-step legal-form"},r.a.createElement(S.b,null,(function(e){var t=e.translate;return r.a.createElement(r.a.Fragment,null,r.a.createElement("form",{autoComplete:"false",onSubmit:function(e){e.preventDefault(),e.stopPropagation(),i()}},r.a.createElement(j,{tooltip:t("steps.legalForm.tooltip.CompanyName"),autoFocus:!0,className:"legal-form__companyName",value:c.companyName,onChange:l,placeholder:t("steps.selectMutation.types.CompanyName"),name:"companyName"}),r.a.createElement(V.a,null),r.a.createElement("div",null,r.a.createElement(S.b,{id:"steps.legalForm.label.legalForm"})),r.a.createElement("div",{className:"legal-form__checkbox-group"},r.a.createElement("label",null,r.a.createElement(W,{id:"checkbox-".concat(E.AG),onChange:function(e){l({persist:function(){},target:{name:"legalForm",value:E.AG}})},name:"legalForm",value:c.legalForm===E.AG}),r.a.createElement("div",null,t("steps.legalForm.options.".concat(E.AG)))),r.a.createElement("label",null,r.a.createElement(W,{id:"checkbox-".concat(E.GmbH),onChange:function(e){l({persist:function(){},target:{name:"legalForm",value:E.GmbH}})},name:"legalForm",value:c.legalForm===E.GmbH}),r.a.createElement("div",null,t("steps.legalForm.options.".concat(E.GmbH)))),r.a.createElement("label",null,r.a.createElement(W,{id:"checkbox-".concat(E.EF),onChange:function(e){l({persist:function(){},target:{name:"legalForm",value:E.EF}})},name:"legalForm",value:c.legalForm===E.EF}),r.a.createElement("div",null,t("steps.legalForm.options.".concat(E.EF)))),r.a.createElement("label",null,r.a.createElement(W,{id:"checkbox-".concat(E.KLG),onChange:function(e){l({persist:function(){},target:{name:"legalForm",value:E.KLG}})},name:"legalForm",value:c.legalForm===E.KLG}),r.a.createElement("div",null,t("steps.legalForm.options.".concat(E.KLG))))),r.a.createElement(j,{value:c.regNum,tooltip:t("steps.legalForm.tooltip.regNum"),onChange:l,placeholder:"".concat(t("state.regNum")," (").concat(t("general.optional"),")"),name:"regNum"})))})),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"})),type:"primary",className:"legal-form__button",disabled:!s,onClick:i}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})))}),null),name:"ChooseLegalForm"},{module:r.a.createElement((function(){var e=Object(n.useContext)(Se),t=Object(n.useContext)(we).mutations,a=Object(n.useContext)(we),l=a.legalForm,c=a.prices,s=Object(n.useState)({mutations:t}),o=Object(i.a)(s,2),u=o[0],d=o[1],p=Object(n.useMemo)((function(){return function(e){return e.mutations.length>0}(u)}),[u]),f=Object(n.useCallback)((function(){p&&(e(y(u.mutations)),e(C()))}),[p,u]),E=Object(n.useCallback)((function(e){var t;t=u.mutations.includes(e.target.name)?Object(m.a)({},u,{mutations:u.mutations.filter((function(t){return t!==e.target.name}))}):Object(m.a)({},u,{mutations:[].concat(Object(N.a)(u.mutations),[e.target.name])}),d(t)}),[u]),b=Object(n.useMemo)((function(){return Object.keys(U[l]).map((function(e){return r.a.createElement(pe,{key:e,name:e,checked:u.mutations.includes(e),displayName:r.a.createElement(S.b,{id:"steps.selectMutation.types.".concat(e)}),price:c[l][e],onChange:E})}))}),[u,l,E,c]);return r.a.createElement("div",{className:"WithPriceTable"},r.a.createElement("div",{className:"MutationSelect"},r.a.createElement("div",{className:"MutationSelect__header"},r.a.createElement(S.b,{id:"steps.selectMutation.question"})),r.a.createElement("div",{className:"MutationSelect__subheader"},r.a.createElement("strong",null,r.a.createElement(S.b,{id:"general.hint"}),":")," ",r.a.createElement(S.b,{id:"steps.selectMutation.hint"})),b),r.a.createElement($,{mutations:u.mutations}),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{className:"MutationSelect__button",disabled:!p,onClick:f,block:!0,title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"}))}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})))}),null),name:"SelectMutation"},{module:r.a.createElement((function(){var e=Object(n.useContext)(Se),t=Object(n.useContext)(we),a=t.companyName,l=t.newCompanyName,c=_((function(){}),{newCompanyName:l.length>0?l:a}),s=c.handleChange,i=c.values,m=Object(n.useMemo)((function(){return function(e){return e.newCompanyName.length>0}(i)}),[i]),u=Object(n.useCallback)((function(){m&&(e(function(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SET_NEW_COMPANY,newCompanyName:e});case 1:case"end":return a.stop()}}))}}(i.newCompanyName)),e(C()))}),[m,i]);return r.a.createElement(S.b,null,(function(e){var t=e.translate;return r.a.createElement("div",{className:"WithPriceTable"},r.a.createElement("div",{className:"mutation-step newCompanyName"},r.a.createElement("div",{className:"newCompanyName__header"},r.a.createElement(S.b,{id:"steps.newCompanyName.header"})),r.a.createElement(r.a.Fragment,null,r.a.createElement(j,{className:"newCompanyName__textInput",value:i.newCompanyName,onChange:s,placeholder:t("steps.newCompanyName.label"),name:"newCompanyName"}))),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"})),type:"primary",className:"newCompanyName__button",disabled:!m,onClick:u,block:!0}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})),r.a.createElement($,null))}))}),null),name:"New Company Name",fields:[h.newCompanyName]},{module:r.a.createElement((function(){var e=Object(n.useContext)(Se),t=_((function(){}),{newCompanyPurpose:Object(n.useContext)(we).newCompanyPurpose}),a=t.handleChange,l=t.values,c=Object(n.useMemo)((function(){return function(e){return e.newCompanyPurpose.length>0}(l)}),[l]),s=Object(n.useCallback)((function(){c&&(e(function(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SET_PURPOSE,newCompanyPurpose:e});case 1:case"end":return a.stop()}}))}}(l.newCompanyPurpose)),e(C()))}),[c,l]);return r.a.createElement("div",{className:"WithPriceTable"},r.a.createElement("div",{className:"mutation-step newCompanyPurpose"},r.a.createElement("div",{className:"newCompanyPurpose__header"},r.a.createElement(S.b,{id:"steps.newCompanyPurpose.header"})),r.a.createElement(r.a.Fragment,null,r.a.createElement(P,{className:"newCompanyPurpose__textInput",value:l.newCompanyPurpose,onChange:a,rows:8,displayName:r.a.createElement(S.b,{id:"steps.newCompanyPurpose.label"}),name:"newCompanyPurpose"}))),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"})),type:"primary",className:"newCompanyPurpose__button",disabled:!c,onClick:s,block:!0}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})),r.a.createElement($,null))}),null),name:"New Company Purpose",fields:[h.newCompanyPurpose]},{module:r.a.createElement((function(){var e=Object(n.useContext)(Se),t=Object(n.useContext)(we),a=t.mutations,l=t.newAddress,c=t.newHeadOfficeAddress,s=_((function(){}),a.includes(v.HeadOffice)?c:l),i=s.handleChange,m=s.values,u=Object(n.useMemo)((function(){return function(e){return e.city.length>0&&e.street.length>0&&e.zip>=1e3&&e.zip<=9999}(m)}),[m]),d=Object(n.useMemo)((function(){return a.includes(v.HeadOffice)}),[a]),p=Object(n.useCallback)((function(){var t=a.filter((function(e){return e!==v.Address&&e!==v.HeadOffice})).reduce((function(e,t){return[].concat(Object(N.a)(e),[t])}),[v.HeadOffice]);e(y(t))}),[a]),E=Object(n.useCallback)((function(){if(u){if(d)return e((t=m,function(e){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:e({type:f.SET_NEW_HEADQUARTER_ADDRESS,address:t});case 1:case"end":return a.stop()}}))})),void e(C());var t;e(function(e){return function(t){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:t({type:f.SET_NEW_ADDRESS,address:e});case 1:case"end":return a.stop()}}))}}(m)),e(C())}}),[u,m,d]);return r.a.createElement(S.b,null,(function(e){var t=e.translate;return r.a.createElement("div",{className:"WithPriceTable"},r.a.createElement("div",{className:"mutation-step newCompanyAddress"},r.a.createElement("div",{className:"newCompanyAddress__header"},t("steps.newCompanyAddress.header")),!d&&r.a.createElement("div",{className:"newCompanyAddress__onlyAddress"},t("steps.newCompanyAddress.onlyAddress"),r.a.createElement(w,{type:"info",title:t("action.switch"),block:!0,onClick:p})),r.a.createElement(r.a.Fragment,null,r.a.createElement(j,{className:"newCompanyAddress__street",value:m.street,error:0===m.street.length,onChange:i,placeholder:t("steps.newCompanyAddress.label.street"),name:"street"}),r.a.createElement(T,{className:"newCompanyAddress__zip",value:0===m.zip?"":m.zip,onChange:i,error:m.zip>9999||m.zip<1e3,placeholder:t("steps.newCompanyAddress.label.zip"),name:"zip",min:1e3,max:9999,step:1}),r.a.createElement(j,{className:"newCompanyAddress__city",value:m.city,error:0===m.city.length,onChange:i,placeholder:t("steps.newCompanyAddress.label.city"),name:"city"}))),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"})),type:"primary",className:"newCompanyAddress__button",disabled:!u,onClick:E,block:!0}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})),r.a.createElement($,null))}))}),null),name:"New Company Address",fields:[h.newAddress,h.newHeadOffice]},{module:r.a.createElement((function(){var e=Object(n.useState)({showModal:!1,edit:void 0}),t=Object(i.a)(e,2),a=t[0],l=t[1],c=Object(n.useContext)(we).people,s=Object(n.useContext)(Se),u=Object(n.useCallback)((function(){l(Object(m.a)({},a,{edit:void 0,showModal:!1}))}),[a]),d=Object(n.useCallback)((function(){l(Object(m.a)({},a,{showModal:!0}))}),[a]),p=Object(n.useCallback)((function(e){var t;s((t=e.id,function(e){return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:e({type:f.DELETE_PERSON,id:t});case 1:case"end":return a.stop()}}))}))}),[]),E=Object(n.useCallback)((function(e){l(Object(m.a)({},a,{edit:e,showModal:!0}))}),[a]),b=Object(n.useMemo)((function(){return c.length>0}),[c]),h=Object(n.useCallback)((function(){b&&s(C())}),[b]);return r.a.createElement("div",{className:"WithPriceTable"},r.a.createElement("div",{style:{minWidth:"300px"},className:"mutation-step People"},r.a.createElement("h2",null,r.a.createElement(S.b,{id:"steps.people.header"})),r.a.createElement("p",null,r.a.createElement(S.b,{id:"general.hint"}),": ",r.a.createElement(S.b,{id:"steps.people.hint"})),r.a.createElement(ce,{onDelete:p,onEdit:E}),a.showModal&&r.a.createElement(ne,{open:a.showModal,onClose:u,title:r.a.createElement(S.b,{id:"steps.people.modal.header"})},r.a.createElement(le,{person:a.edit,onSuccess:u})),r.a.createElement(w,{block:!0,onClick:d,title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.add"}),r.a.createElement("i",{className:"fas fa-user-plus"}))})),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{block:!0,onClick:h,disabled:!b,title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"}))}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})),r.a.createElement($,null))}),null),name:"People",fields:[h.people]},{module:r.a.createElement((function(){var e=Object(n.useContext)(we).peopleTransfer,t=Object(n.useContext)(Se),a=Object(n.useState)({showModal:!1,edit:void 0}),l=Object(i.a)(a,2),c=l[0],s=l[1],u=Object(n.useCallback)((function(){s(Object(m.a)({},c,{edit:void 0,showModal:!1}))}),[c]),d=Object(n.useCallback)((function(){s(Object(m.a)({},c,{showModal:!0}))}),[c]),p=Object(n.useCallback)((function(e){var a;t((a=e.id,function(e){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:e({type:f.DELETE_PEOPLE_TRANSFER,id:a});case 1:case"end":return t.stop()}}))}))}),[]),E=Object(n.useCallback)((function(e){s(Object(m.a)({},c,{edit:e,showModal:!0}))}),[c]),b=Object(n.useMemo)((function(){return e.length>0}),[e]),h=Object(n.useCallback)((function(){b&&t(C())}),[b]);return r.a.createElement("div",{className:"WithPriceTable"},r.a.createElement("div",{className:"mutation-step PeopleTransfer"},r.a.createElement("h2",null,r.a.createElement(S.b,{id:"steps.peopleTransfer.header"})),r.a.createElement(ue,{onDelete:p,onEdit:E}),r.a.createElement(w,{onClick:d,title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.add"})),block:!0}),c.showModal&&r.a.createElement(ne,{open:c.showModal,onClose:u,title:r.a.createElement(S.b,{id:"steps.peopleTransfer.edit"})},r.a.createElement(de,{transfer:c.edit,onSuccess:u}))),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{onClick:h,disabled:!b,title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-right"}),r.a.createElement(S.b,{id:"action.next"})),block:!0}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})),r.a.createElement($,null))}),null),name:"PeopleTransfer",fields:[h.peopleTransfer]},{module:r.a.createElement((function(){var e=Object(n.useContext)(we),t=Object(n.useContext)(Se);return r.a.createElement("div",{className:"WithPriceTable"},r.a.createElement("div",{className:"Overview"},r.a.createElement("h2",null,r.a.createElement(S.b,{id:"steps.overview.header"}),":"),e.mutations.includes(v.CompanyName)&&r.a.createElement("div",{className:"Overview__row"},r.a.createElement("div",{className:"Overview__row__header"},r.a.createElement(S.b,{id:"steps.selectMutation.types.CompanyName"})),r.a.createElement("div",{className:"Overview__row__content"},r.a.createElement(S.b,{id:"general.new"}),": ",e.newCompanyName)),e.mutations.includes(v.Address)&&!e.mutations.includes(v.HeadOffice)&&r.a.createElement("div",{className:"Overview__row"},r.a.createElement("div",{className:"Overview__row__header"},r.a.createElement(S.b,{id:"steps.selectMutation.types.Address"})),r.a.createElement("div",{className:"Overview__row__content"},r.a.createElement(S.b,{id:"general.new"}),": ",e.newAddress.street," ",e.newAddress.zip," ",e.newAddress.city)),e.mutations.includes(v.HeadOffice)&&r.a.createElement("div",{className:"Overview__row"},r.a.createElement("div",{className:"Overview__row__header"},r.a.createElement(S.b,{id:"steps.selectMutation.types.HeadOffice"})),r.a.createElement("div",{className:"Overview__row__content"},r.a.createElement(S.b,{id:"general.new"}),":"," ",e.newHeadOfficeAddress.street,", ",e.newHeadOfficeAddress.zip," ",e.newHeadOfficeAddress.city)),e.mutations.includes(v.Purpose)&&r.a.createElement("div",{className:"Overview__row"},r.a.createElement("div",{className:"Overview__row__header"},r.a.createElement(S.b,{id:"steps.selectMutation.types.Purpose"})),r.a.createElement("div",{className:"Overview__row__content"},r.a.createElement(S.b,{id:"general.new"}),": ",e.newCompanyPurpose)),e.mutations.includes(v.Person)&&r.a.createElement("div",{className:"Overview__row"},r.a.createElement("div",{className:"Overview__row__header"},r.a.createElement(S.b,{id:"steps.selectMutation.types.Person"})),r.a.createElement("div",{className:"Overview__row__content"},e.people.map((function(e){return r.a.createElement("div",{className:"Person"},r.a.createElement("div",null,ae(e)),r.a.createElement("div",null,r.a.createElement(S.b,{id:"steps.people.state.".concat(e.state)})))})))),e.mutations.includes(v.Transfer)&&r.a.createElement("div",{className:"Overview__row"},r.a.createElement("div",{className:"Overview__row__header"},r.a.createElement(S.b,{id:"steps.selectMutation.types.Transfer"})),r.a.createElement("div",{className:"Overview__row__content"},e.peopleTransfer.map((function(e){return r.a.createElement(ee,{transfer:e,key:"".concat(e.id)})}))))),r.a.createElement($,null),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"})),block:!0,className:"Overview__next",onClick:function(){t(C())}}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})))}),null),name:"Overview"},{module:r.a.createElement((function(){var e=Object(n.useContext)(Se),t=Object(n.useContext)(we),a=Object(n.useState)(!1),l=Object(i.a)(a,2),c=l[0],s=l[1],u=Object(n.useState)(!1),d=Object(i.a)(u,2),p=d[0],E=d[1],b=Object(n.useState)(!1),h=Object(i.a)(b,2),v=h[0],g=h[1],N=_((function(){}),{gender:"",firstName:"",lastName:"",street:"",zip:"",city:"",email:"",mobile:""}),y=N.handleChange,O=N.values,P=Object(n.useMemo)((function(){return function(e,t){var a=!0,n=[e.firstName,e.lastName,e.gender];return a=t&&n.reduce((function(e,t){return e&&t.length>0}),a)&&e.mobile.length>3&&ge(e.mobile)&&Ne(e.email)}(O,p)}),[O,p]),T=Object(n.useMemo)((function(){return{lastName:!(O.lastName.length>0),firstName:!(O.firstName.length>0),gender:!["male","female"].includes(O.gender),street:!(O.street.length>0),zip:!(O.zip.length>0),city:!(O.city.length>0),email:!Ne(O.email),mobile:!ge(O.mobile)}}),[O]),A=Object(n.useCallback)((function(){var a;P&&!c?(s(!0),e((a=O,function(e){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:e({type:f.SET_CONTACT_DETAILS,contact:a});case 1:case"end":return t.stop()}}))})),ve.a.post("/wp-json/fasoon-backend/v1/request",Object(m.a)({},t,{contactDetails:O})).then((function(t){e(C()),s(!1)})).catch((function(e){s(!1)}))):g(!0)}),[P,O,c]);return r.a.createElement(S.b,null,(function(e){var a=e.translate;return r.a.createElement("div",{className:"mutation-step contactDetails"},r.a.createElement("div",{className:"contactDetails__header"},r.a.createElement(S.b,{id:"steps.contactDetails.header"})),r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{id:"totalPrice","data-price":Q(t)}),r.a.createElement(F,{onChange:y,value:O.gender,name:"gender",error:T.gender&&v,displayName:a("steps.contactDetails.title"),options:[{id:0,value:"",displayName:a("general.choose")},{id:1,value:"male",displayName:a("steps.people.gender.male")},{id:2,value:"female",displayName:a("steps.people.gender.female")}],required:!0}),r.a.createElement(j,{className:"contactDetails__textInput",value:O.firstName,error:T.firstName&&v,onChange:y,displayName:r.a.createElement(S.b,{id:"steps.contactDetails.firstName"}),name:"firstName"}),r.a.createElement(j,{className:"contactDetails__textInput",value:O.lastName,error:T.lastName&&v,onChange:y,displayName:r.a.createElement(S.b,{id:"steps.contactDetails.lastName"}),name:"lastName"}),r.a.createElement(j,{className:"contactDetails__textInput",value:O.street,error:T.street&&v,onChange:y,displayName:r.a.createElement(S.b,{id:"steps.contactDetails.street"}),name:"street"}),r.a.createElement(j,{className:"contactDetails__textInput",value:O.zip,error:T.zip&&v,onChange:y,displayName:r.a.createElement(S.b,{id:"steps.contactDetails.zip"}),name:"zip"}),r.a.createElement(j,{className:"contactDetails__textInput",value:O.city,error:T.city&&v,onChange:y,displayName:r.a.createElement(S.b,{id:"steps.contactDetails.city"}),name:"city"}),r.a.createElement(fe,{className:"contactDetails__textInput",value:O.email,error:T.email&&v,onChange:y,displayName:r.a.createElement(S.b,{id:"steps.contactDetails.email"}),name:"email"}),r.a.createElement("div",null,r.a.createElement("label",{htmlFor:"contactMobileInput"},"Mobile"),r.a.createElement(be.a,{className:v&&T.mobile?"":"error",inputExtraProps:{id:"contactMobileInput"},autoFormat:!1,defaultCountry:"ch",isValid:ge,value:O.mobile,onChange:function(e){y({persist:function(){},target:{name:"mobile",value:e}})}}))),r.a.createElement(W,{id:"agb-checkbox",name:"agb",error:!p,value:p,onChange:function(){E(!p)},displayName:a("steps.contactDetails.agb")}),r.a.createElement("div",{className:"ButtonGroup"},r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(S.b,{id:"action.next"}),r.a.createElement("i",{className:"fas fa-chevron-right"})),type:"primary",className:"contactDetails__button",disabled:c||!P,onClick:A,block:!0}),r.a.createElement(w,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement("i",{className:"fas fa-chevron-left"}),r.a.createElement(S.b,{id:"action.back"})),type:"info",className:"legal-form__button",onClick:function(){window.history.back()}})))}))}),null),name:"ContactDetails"},{module:r.a.createElement((function(){return r.a.createElement("div",null,r.a.createElement("div",{className:"MutationSuccess"},r.a.createElement(S.b,{id:"steps.success.text"})))}),null),name:"Success"}],Oe=function(e,t){switch(t.type){case f.NEXT_STEP:return Object(m.a)({},e,{currentStep:e.currentStep+1});case f.SET_STEP:return Object(m.a)({},e,{currentStep:Math.min(t.step,Ce.length)});case f.SET_LEGAL_FORM:return Object(m.a)({},e,{legalForm:t.legalForm});case f.SET_PRICES:return Object(m.a)({},e,{prices:t.prices});case f.SET_MUTATIONS:return Object(m.a)({},e,{mutations:t.mutations});case f.SAVE_PEOPLE_TRANSFER:var a=e.peopleTransfer.some((function(e){return e.id===t.transfer.id}));return Object(m.a)({},e,{peopleTransfer:[].concat(Object(N.a)(e.peopleTransfer.map((function(e){return e.id!==t.transfer.id?e:t.transfer}))),Object(N.a)(a?[]:[t.transfer]))});case f.DELETE_PEOPLE_TRANSFER:return Object(m.a)({},e,{peopleTransfer:Object(N.a)(e.peopleTransfer.filter((function(e){return e.id!==t.id})))});case f.SAVE_PERSON:var n=e.people.reduce((function(e,t){return Math.max(e,t.id)}),0),r=0===t.person.id?Object(m.a)({},t.person,{id:n+1}):t.person;return Object(m.a)({},e,{people:[].concat(Object(N.a)(e.people.filter((function(e){return e.id!==r.id}))),[r])});case f.DELETE_PERSON:return Object(m.a)({},e,{people:Object(N.a)(e.people.filter((function(e){return e.id!==t.id}))),peopleTransfer:Object(N.a)(e.peopleTransfer.filter((function(e){return e.fromId!==t.id&&e.toId!==t.id})))});case f.SET_COMPANY:return Object(m.a)({},e,{companyName:t.companyName});case f.SET_NEW_ADDRESS:return Object(m.a)({},e,{newAddress:t.address});case f.SET_NEW_HEADQUARTER_ADDRESS:return Object(m.a)({},e,{newHeadOfficeAddress:t.address});case f.SET_CONTACT_DETAILS:return Object(m.a)({},e,{contactDetails:t.contact});case f.SET_NEW_COMPANY:return Object(m.a)({},e,{newCompanyName:t.newCompanyName});case f.SET_PURPOSE:return Object(m.a)({},e,{newCompanyPurpose:t.newCompanyPurpose});case f.SET_REG_NUM:return Object(m.a)({},e,{regNum:t.regNum});default:return e}},_e=(ye={currentStep:1,isLoading:!1,companyName:"",newCompanyName:"",newCompanyPurpose:"",contactDetails:{firstName:"",lastName:"",email:"",city:"",gender:"",mobile:"",street:"",zip:""},newAddress:{city:"",street:"",zip:0},newHeadOfficeAddress:{city:"",street:"",zip:0},legalForm:E.NotSet,regNum:"",mutations:[],note:"",prices:K},Object(g.a)(ye,h.people,[]),Object(g.a)(ye,h.peopleTransfer,[]),ye),we=Object(n.createContext)(Object(m.a)({},_e)),Se=Object(n.createContext)({});function je(){var e=d()(Oe,_e),t=Object(i.a)(e,2),a=t[0],l=t[1];return Object(n.useEffect)((function(){!function(){var e;o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.a.awrap(Pe());case 2:e=t.sent,l({type:f.SET_PRICES,prices:e});case 4:case"end":return t.stop()}}))}()}),[]),r.a.createElement(we.Provider,{value:Object(m.a)({},a)},r.a.createElement(Se.Provider,{value:l},r.a.createElement(p,null,r.a.createElement(Te,null),r.a.createElement(Y,null))))}function Pe(){var e;return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.a.awrap(ve.a.get("/wp-json/fasoon-backend/v1/prices"));case 2:return e=t.sent,t.abrupt("return",e.data);case 4:case"end":return t.stop()}}))}function Te(){var e=Object(n.useContext)(we),t=function(e){for(var t=e.mutations,a=e.legalForm,n=e.currentStep,r=0,l=1;l<=n;l++)J(l,a,t)&&(r+=1);return r}(e),a=function(e){var t=e.mutations,a=e.legalForm,n=0;return Ce.forEach((function(e,r){J(r+1,a,t)&&(n+=1)})),n}(e),l=Object(n.useRef)(null);return Object(n.useEffect)((function(){l&&l.current&&1!==t&&l.current.scrollIntoView()}),[t,l]),1===t||Ce.length===e.currentStep?null:r.a.createElement("div",{ref:l,className:"StepIndicator"},r.a.createElement("div",{className:"StepIndicator__wrapper"},r.a.createElement("div",{className:"StepIndicator__progress",style:{width:"calc(".concat(100*(t-2)/(a-2),"% - ( ").concat(100*(t-2)/(a-2)/100," * 150px ))")}},r.a.createElement("div",{className:"StepIndicator__progress__percentage"},t-2>0&&"".concat(5*Math.floor(100*(t-2)/(a-2)/5),"%"))),r.a.createElement("div",{className:"StepIndicator__step"},r.a.createElement(S.b,{id:"general.step"})," ",t-1)))}a(85);var Ae=Object(S.c)((function(e){var t=e.addTranslation;return Object(n.useEffect)((function(){!function(){var e,a;o.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,o.a.awrap(fetch("/wp-json/fasoon-backend/v1/translations"));case 2:return e=n.sent,n.next=5,o.a.awrap(e.json());case 5:a=n.sent,t(a);case 7:case"end":return n.stop()}}))}()}),[t]),r.a.createElement(je,null)}));Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var ke=a(35),Fe=a(36),xe=a(16),Me=a.n(xe),Ie=(a(87),function(e){return e.defaultTranslation});c.a.render(r.a.createElement(S.a,{initialize:function(){var e,t=(e=window.location.search).slice(e.indexOf("?")+1).split("&").reduce((function(e,t){var a=t.indexOf("=");if(a<0)return Object.assign(e,Object(g.a)({},t,null));var n=t.slice(0,a),r=t.slice(a+1);return Object.assign(e,Object(g.a)({},n,decodeURIComponent(r)))}),{}).lang,a=void 0===t?"de":t,n=["en","de","fr"].includes(a)?a:"de";return Me.a.locale(n),{languages:[{name:"English",code:"en"},{name:"Deutsch",code:"de"},{name:"Fran\xe7ais",code:"fr"}],translation:Fe,options:{renderToStaticMarkup:ke.renderToStaticMarkup,defaultLanguage:n,onMissingTranslation:Ie}}}()},r.a.createElement(Ae,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[38,1,2]]]); //# sourceMappingURL=main.f15d2740.chunk.js.map