text: (this["webpackJsonpg-app"]=this["webpackJsonpg-app"]||[]).push([[0],{256:function(e,t,n){},267:function(e,t,n){"use strict";n.r(t);var a=n(40),r=n(0),i=n(1),s=n(94),c=n.n(s),o=n(133),l=n(26),u=n(12),j=n(10),d=n(25),b=(n(255),n(256),n(17)),h=n.n(b),O=n(29),m=n(28);function f(){var e=Object(m.a)(["\n  mutation deleteUser($id: ID!, $store: Int!) {\n    deleteUser(id: $id, store: $store) {\n      id\n      name\n    }\n  }\n"]);return f=function(){return e},e}function p(){var e=Object(m.a)(["\n  mutation updateUser($id: ID!, $name: String!, $type: String!, $store: Int!) {\n    updateUser(id: $id, name: $name, type: $type, store: $store) {\n      id\n      name\n      type\n      store\n      username\n    }\n  }\n"]);return p=function(){return e},e}function x(){var e=Object(m.a)(["\n  mutation addUser(\n    $name: String!\n    $username: String!\n    $type: String!\n    $store: Int!\n    $password: String!\n  ) {\n    addUser(\n      name: $name\n      username: $username\n      type: $type\n      store: $store\n      password: $password\n    ) {\n      id\n      name\n      type\n      store\n      username\n    }\n  }\n"]);return x=function(){return e},e}function A(){var e=Object(m.a)(["\n  mutation login($username: String!, $password: String!) {\n    login(username: $username, password: $password) {\n      value\n    }\n  }\n"]);return A=function(){return e},e}function w(){var e=Object(m.a)(["\n  query {\n    me {\n      type\n      store\n    }\n  }\n"]);return w=function(){return e},e}function g(){var e=Object(m.a)(["\n  query {\n    allUsers {\n      id\n      name\n      username\n      store\n      type\n    }\n  }\n"]);return g=function(){return e},e}var v=Object(j.gql)(g()),B=Object(j.gql)(w()),C=Object(j.gql)(A()),k=Object(j.gql)(x()),y=Object(j.gql)(p()),S=Object(j.gql)(f()),L=n(46),D=n(14),E=n(293),Q=n(294),N=n(295),F=n(287),T=n(141),I=n(270),M=n(98),R=function(e,t,n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3);var r="expires=".concat(a.toUTCString());document.cookie="".concat(e,"=").concat(t,";").concat(r,";path=/")},U=function(e){var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";");if(n){var a=n.filter((function(e){return e.startsWith(t)}));if(a[0]&&a[0].startsWith(t))return a[0].substring(t.length,a[0].length)}return""},V=D.c().shape({username:D.d().min(4,"K\xe4ytt\xe4j\xe4nimi liian lyhyt").max(15,"K\xe4ytt\xe4j\xe4nimi liian pitk\xe4").required("K\xe4ytt\xe4j\xe4nimi puuttuu"),password:D.d().min(8,"Salasana liian lyhyt").required("Salasana puuttuu")}),P=function(e){var t=e.setToken,n=Object(j.useMutation)(C),a=Object(u.a)(n,1)[0],s=Object(i.useState)(!1),c=Object(u.a)(s,2),o=c[0],l=c[1],d=function(){var e=Object(O.a)(h.a.mark((function e(n){var r,i,s,c;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.username,i=n.password,e.prev=1,e.next=4,a({variables:{username:r,password:i}});case 4:s=e.sent,c=s.data,t(c.login.value),R("g-app-user-token",c.login.value,1),l(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),l(!0);case 15:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(t){return e.apply(this,arguments)}}();return Object(r.jsx)(E.a,{placeholder:!0,children:Object(r.jsx)(Q.a,{columns:1,relaxed:"very",stackable:!0,children:Object(r.jsx)(Q.a.Column,{children:Object(r.jsxs)("div",{className:"form",children:[Object(r.jsx)(N.a,{as:"h1",children:"Kirjaudu"}),Object(r.jsx)(L.a,{initialValues:{username:"",password:""},validationSchema:V,onSubmit:function(e,t){var n=t.setSubmitting;d(e),n(!1)},children:function(e){return Object(r.jsxs)(F.a,{onSubmit:e.handleSubmit,children:[Object(r.jsx)(F.a.Input,{type:"text",onChange:e.handleChange,value:e.values.username,name:"username",icon:"user",iconPosition:"left",label:"K\xe4ytt\xe4j\xe4nimi",placeholder:"k\xe4ytt\xe4j\xe4nimi"}),e.errors.username&&Object(r.jsx)(T.a,{className:"errorMessage",pointing:!0,color:"yellow",children:e.errors.username}),Object(r.jsx)(F.a.Input,{type:"password",onChange:e.handleChange,value:e.values.password,name:"password",icon:"lock",iconPosition:"left",label:"Salasana",placeholder:"salasana"}),e.errors.password&&Object(r.jsx)(T.a,{className:"errorMessage",pointing:!0,color:"yellow",children:e.errors.password}),Object(r.jsxs)(I.a,{animated:!0,type:"submit",disabled:e.isSubmitting,color:"green",style:{margin:"4px"},children:[Object(r.jsx)(I.a.Content,{visible:!0,children:"Kirjaudu"}),Object(r.jsx)(I.a.Content,{hidden:!0,children:Object(r.jsx)(M.a,{name:"arrow right"})})]}),o&&Object(r.jsx)(T.a,{color:"red",children:"V\xe4\xe4r\xe4 k\xe4ytt\xe4j\xe4nimi tai salasana"})]})}})]})})})})},H=n(291),W=n(132),Y=function(e){return Object(r.jsx)(H.a.Item,{active:e.activeItem===e.name,children:Object(r.jsx)(W.b,{to:e.link?e.link:"/",children:Object(r.jsx)(I.a,Object(a.a)(Object(a.a)({},e.children),{},{name:e.name,color:e.color,onClick:e.handleClick,children:e.text}))})})},G=function(e){var t,n=e.activePage,a=e.setActivePage,i=e.logout,s=Object(j.useQuery)(B,{fetchPolicy:"network-only"}),c=s.data;s.loading||c&&(t=c.me.type);var o=function(e,t){var n=t.name;a(n)};return Object(r.jsxs)(H.a,{pointing:!0,style:{marginBottom:"2px"},children:[Object(r.jsx)(Y,{link:"/puheliittymat",name:"puhe",color:"green",activeItem:n,handleClick:o,text:"Puheliittym\xe4t"}),Object(r.jsx)(Y,{link:"/nettiliittymat",name:"netti",color:"green",activeItem:n,handleClick:o,text:"Nettiliittym\xe4t"}),Object(r.jsx)(Y,{link:"/tietoturva",name:"tietoturva",color:"green",activeItem:n,handleClick:o,text:"Tietoturva"}),Object(r.jsxs)(H.a.Menu,{position:"right",children:[("admin"===t||"storeAdmin"===t)&&Object(r.jsx)(Y,{link:"/admin",name:"admin",activeItem:n,handleClick:o,text:"Admin",pointer:"down"}),Object(r.jsx)(Y,{name:"logout",activeItem:n,handleClick:i,text:"Kirjaudu ulos"})]})]})};function K(){var e=Object(m.a)(["\n  fragment SubscriptionInfoWithOffer on Subscription {\n    operator {\n      name\n    }\n    active\n    name\n    talk\n    sms\n    speed\n    unlimited\n    eu\n    price\n    hasOffer\n    offer\n    offerLength\n    bindingOffer\n    offerValue\n    oneTimeDiscount\n    equivelentSub {\n      name\n    }    \n    id\n  }\n"]);return K=function(){return e},e}function q(){var e=Object(m.a)(["\n  fragment SubscriptionInfo on Subscription {\n    operator {\n      name\n      id\n    }\n    active\n    name\n    talk\n    sms\n    speed\n    unlimited\n    eu\n    hasOffer\n    price    \n    equivelentSub {\n      name\n    }    \n    id\n  }\n"]);return q=function(){return e},e}var z=Object(j.gql)(q()),J=Object(j.gql)(K());function Z(){var e=Object(m.a)(["\n  mutation removeOffer($id: ID!) {\n    removeOffer(id: $id) {\n      id\n    }\n  }\n"]);return Z=function(){return e},e}function X(){var e=Object(m.a)(["\n  mutation addOffer(\n    $id: ID!\n    $offer: String!\n    $offerLength: Int\n    $bindingOffer: Boolean\n    $oneTimeDiscount: Int\n    $offerValue: Int\n  ) {\n    addOffer(\n      id: $id\n      offer: $offer\n      offerLength: $offerLength\n      bindingOffer: $bindingOffer\n      oneTimeDiscount: $oneTimeDiscount\n      offerValue: $offerValue\n    ) {\n      ...SubscriptionInfoWithOffer\n    }\n  }\n  ","\n"]);return X=function(){return e},e}function $(){var e=Object(m.a)(["\n  query {\n    allOperators {\n      name\n      id\n    }\n  }\n"]);return $=function(){return e},e}function _(){var e=Object(m.a)(["\n  mutation deleteSubscription($id: ID!) {\n    deleteSubscription(id: $id) {\n      name\n      id\n    }\n  }\n"]);return _=function(){return e},e}function ee(){var e=Object(m.a)(["\n  mutation modifiSubscription(\n    $id: ID!\n    $name: String\n    $talk: String\n    $sms: String\n    $speed: String\n    $unlimited: Boolean\n    $eu: Int\n    $active: Boolean\n    $price: String\n  ) {\n    modifySubscription(\n      id: $id\n\n      name: $name\n      talk: $talk\n      sms: $sms\n      speed: $speed\n      unlimited: $unlimited\n      eu: $eu\n      active: $active\n      price: $price\n    ) {\n      ...SubscriptionInfo\n    }\n  }\n  ","\n"]);return ee=function(){return e},e}function te(){var e=Object(m.a)(["\n  mutation addSubscription(\n    $operator: String!\n    $name: String!\n    $talk: String!\n    $sms: String!\n    $speed: String!\n    $unlimited: Boolean!\n    $eu: Int!\n    $active: Boolean!\n    $price: String!\n  ) {\n    addSubscription(\n      operator: $operator\n      name: $name\n      talk: $talk\n      sms: $sms\n      speed: $speed\n      unlimited: $unlimited\n      eu: $eu\n      active: $active\n      price: $price\n    ) {\n      ...SubscriptionInfo\n    }\n  }\n  ","\n"]);return te=function(){return e},e}function ne(){var e=Object(m.a)(["\n  query getSubscriptionsByOperator($id: ID!) {\n    getSubscriptionsByOperator(id: $id) {\n      name\n      id\n    }\n  }\n"]);return ne=function(){return e},e}function ae(){var e=Object(m.a)(["\n  query {\n    allActiveSubscriptions {\n      ...SubscriptionInfo\n    }\n  }\n  ","\n"]);return ae=function(){return e},e}function re(){var e=Object(m.a)(["\n  query {\n    allSubscriptionsWithOffer {\n      ...SubscriptionInfoWithOffer\n    }\n  }\n  ","\n"]);return re=function(){return e},e}function ie(){var e=Object(m.a)(["\n  query {\n    allSubscriptions {\n      ...SubscriptionInfo\n    }\n  }\n  ","\n"]);return ie=function(){return e},e}var se=Object(j.gql)(ie(),z),ce=Object(j.gql)(re(),J),oe=Object(j.gql)(ae(),z),le=(Object(j.gql)(ne()),Object(j.gql)(te(),z)),ue=Object(j.gql)(ee(),z),je=Object(j.gql)(_()),de=Object(j.gql)($()),be=Object(j.gql)(X(),J),he=Object(j.gql)(Z()),Oe=n(292),me=n(296),fe=n(284),pe=n(283),xe=n(282),Ae=function(e){var t=e.value;return"boolean"!==typeof t?null:t?Object(r.jsx)(M.a,{name:"check circle",color:"green"}):Object(r.jsx)(M.a,{name:"x",color:"red"})},we=function(){return Object(r.jsx)("div",{children:Object(r.jsx)(E.a,{style:{height:"300px"},children:Object(r.jsx)(me.a,{active:!0,inverted:!0,children:Object(r.jsx)(fe.a,{inverted:!0,children:"Loading"})})})})},ge=function(e){var t=e.error;return console.log(t),Object(r.jsx)("div",{children:"Virhe"})},ve=function(e){var t,n=e.label,a=e.name,i=e.type,s=e.onChange,c=e.onBlur,o=e.value,l=e.error,u=e.touched,j=e.disabled,d=e.placeholder;return Object(r.jsxs)(F.a.Field,{children:[Object(r.jsx)(F.a.Field,{label:n}),Object(r.jsx)(pe.a,{fluid:!0,disabled:j,name:a,type:i,onChange:s,onBlur:c,value:o,placeholder:d,step:"number"===i&&".01"}),u&&l?(t=l,Object(r.jsx)(T.a,{pointing:!0,color:"yellow",children:t})):null]})},Be=function(e){var t=e.label,n=e.id,a=e.name,i=e.checked,s=e.onChange,c=e.disabled;return Object(r.jsx)(F.a.Input,{children:Object(r.jsxs)(F.a.Group,{className:"radioLabelGroup",children:[Object(r.jsx)(F.a.Field,{label:t}),Object(r.jsx)(xe.a,{disabled:c,id:n,type:"checkbox",toggle:!0,name:a,checked:i,onChange:s})]})})},Ce=function(e){var t=e.action,n=e.amount;return Object(r.jsxs)("div",{className:"flexRow addRemoveInputContainer",children:[Object(r.jsx)(I.a,{icon:"minus",onClick:function(){return t("SUBTRACT")}}),Object(r.jsx)(T.a,{className:"amount",children:n}),Object(r.jsx)(I.a,{icon:"add",onClick:function(){return t("ADD")}})]})},ke=n(288),ye=n(228),Se=n.p+"static/media/Telia_48px.032596ca.png",Le=n.p+"static/media/Elisa_300px.c0785154.png",De=n.p+"static/media/Telia_300px.9315b503.png",Ee=function(e){var t=e.operator,n=e.size;switch(t){case"Dna":return Object(r.jsx)(ye.a,{src:"medium"===n?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAMAAABOo35HAAAQWXpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHja7ZpZciUpsobfWcVdArPDcgAHs95BL/9+ThyNKZVVt/VjSZZniIEAH/4Bpdv//tdx/8dP7iG6XKTVXqvnJ/fc4+BD88/P8x58vq/3J67Xp/D1uHs/EXlPvKfnRN3Pexgc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RTQCP6ridRc7F/wZzP767v3vhPwP9M9B/OZCBcnf/D2O1P1+OI2gdAAABhWlDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw0AcxV9TpX5UHMwg4pChOogFURFHqWIRLJS2QqsOJpd+QZOGJMXFUXAtOPixWHVwcdbVwVUQBD9AnBydFF2kxP8lhRaxHhz34929x907QKiVmGZ1TACabpuJaERKZ1alwCt6ISKAbozJzDJiycUU2o6ve/j4ehfmWe3P/Tn61KzFAJ9EPMcM0ybeIJ7ZtA3O+8QiK8gq8TnxuEkXJH7kuuLxG+e8ywLPFM1UYp5YJJbyLay0MCuYGvE0cUjVdMoX0h6rnLc4a6UKa9yTvzCY1VeSXKc5jCiWEEMcEhRUUEQJNsK06qRYSNB+pI1/yPXHyaWQqwhGjgWUoUF2/eB/8LtbKzc16SUFI0Dni+N8jACBXaBedZzvY8epnwD+Z+BKb/rLNWD2k/RqUwsdAf3bwMV1U1P2gMsdYPDJkE3Zlfw0hVwOeD+jb8oAA7dAz5rXW2Mfpw9AirpavgEODoHRPGWvt3l3V2tv/55p9PcDaKNyoxC/4L0AAALNUExURQAAAP///wAAANsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAetsAevHB8TEAAAABdFJOUwBA5thmAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+QLFAcPMqOqWScAAAKySURBVHja7d1BbsMwDARAAvz/n4sCPTeSJTKKMns2lvK0tWE5SCNlNBEMYMGCBQsWLAawYMGCBQsWA1iwYMGCBYsBLFiwYMGCxQAWLFiwYMFiAAsWLFiwYDGABQsWLFiwGMCCBQsWLFgMYMGCBQsWLAawYMGCBQsWA1iwYMGCBYsBLFiwYMGCxQAWLFiwYMFiAAsWLFiwYDGABQsWLFiwGMCCBQsWrE89xb+0YcVQHpzBnrrhMQdhjS9nc93MjJOwxhp3980NOAhrZDWb62brj8KK7r7p9pOwXvVGpVbVH3cdVrT2tdw7CrH+rY4yrcJLYSlW9OE/Kz4KK9rwq+7anVjRhd9x3/g0rMh33TY6sKKp7w6saMSKqNWqx4oW/MLr4CdjxdVY0YRVcxn8cKy4GitasF4ev+Op8zHW+HqH+iZO//G+6ElYE6vZXDd66FFYuRcrV7EWChuwci/WcN/241qw8ulPuABruPBtWLkXK+PxvWWpsAkr92IlrMWnmPL1vRMrFrDyaqyEBetirIQFCxYsWLBgwYIFCxYsWLBgwYIFCxYsWLBg1byw2P95NliwYMGCBQsWLFiwYMGCBQsWLFiwYMGyrQwLFixYsGDBggUL1pVYAWsJK2E9/8WCBWt6QMAaHjC4XQQrt38l1M1Y4xuRX481s2n7bVhLO9ywJt4GwIK1jJWwYFVgJaz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E6iAVREUepYhEslLZCqw4ml35Bk4YkxcVRcC04+LFYdXBx1tXBVRAEP0CcHJ0UXaTE/yWFFrEeHPfj3b3H3TtAqJWYZnVMAJpum4loREpnVqXAK3ohIoBujMnMMmLJxRTajq97+Ph6F+ZZ7c/9OfrUrMUAn0Q8xwzTJt4gntm0Dc77xCIryCrxOfG4SRckfuS64vEb57zLAs8UzVRinlgklvItrLQwK5ga8TRxSNV0yhfSHquctzhrpQpr3JO/MJjVV5JcpzmMKJYQQxwSFFRQRAk2wrTqpFhI0H6kjX/I9cfJpZCrCEaOBZShQXb94H/wu1srNzXpJQUjQOeL43yMAIFdoF51nO9jx6mfAP5n4Epv+ss1YPaT9GpTCx0B/dvAxXVTU/aAyx1g8MmQTdmV/DSFXA54P6NvygADt0DPmtdbYx+nD0CKulq+AQ4OgdE8Za+3eXdXa2//nmn09wNoo3KjEL/gvQAAAs1QTFRFAAAA////AAAA2wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB62wB68cHxMQAAAAF0Uk5TAEDm2GYAAAABYktHRACIBR1IAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH5AsUBw4sQL5VBQAAAFNJREFUSMft1MEKACAIA9CB///PdSjCVFCoQ7FdZIcHIRKkGBAQ/AUAAzBiy6wBgCmGbwBeEResEZenAUpA7fUKKD/p1JbUNeSBFIFkAX8NAoKeBhLOFyAARc4nAAAAAElFTkSuQmCC",alt:"DNA",wrapped:!0});case"Telia":return Object(r.jsx)(ye.a,{src:"medium"===n?De:Se,alt:"Telia",wrapped:!0});case"Elisa":return Object(r.jsx)(ye.a,{src:"medium"===n?Le:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHsAAAAwCAYAAAAxWAXQAAARanpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZlpkiypjoX/s4peAiCEYDmMZr2DXn5/IuIOdateT9aZlpOHhzsuHZ2BDOc//v2Gf+OjpN5CUWu11xr5KL30PPilxc/H52eK5X1/Hza/r6W/Hg/yPR4zh/yP74F6vucPjutvFyrf4/Ovx4Ot73Xa90Lp54Xfh/id/ff9XeT3QpI/x9P379C/bxj1t8f5fuX1vez34n/+XYxibOV6kkM+kiS+7/lzJ/l8DY6k913zjyMije9Z6t/rF36W7h8KWOWf6xd/rEx+leNzoR+PVf+o0/d40j+Oy8/b57+sKOXvKfnXC68GO974+8dv9bt3t3vP5+lGqYFy1e9D/XjE9xsngpgi722VT+NL+d3eZ+ezxREXXds86gxx8kdPmYrfVNJOI9103s+VFkss+WTjZ84ryzvWxHLPi/InKf6ZbrYgXTa9yLLonHA4/1xLevftfj9u1rjzTpyZExejx3/9DH8e+L9+/uVC9z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dIejcwJ+SzaFOSsp4DnTTMHVGSPmNRCP9VnT6sbpH0OblIuMJmq+fKVsVFLx0DuS1BDJJaxs1QbWV9rXzpNW/QXoA5T2sQhGB8jFJ7I7ozKgRaBiGwATjHskHGo1F6/U7LhOJb6eL/V+4KyhG90H01YD7wJLEZQqD90aKuDLLfif2gxEccarxdGf8C0G5YAf+NIZk5H1Ll7vwCS7xDQJ0hKUnCyK8SvcmPq88dmCoBbKHnqP0SWePXh3hhSxg8zEAyr4r9Ku2/AyFi82Az0wLH26F2aqI9w6zLH3AVG+vnVNTHQKizzDdp4cethcg6jTpd64ljeRCu8gsp1ixcrgdurBSqSyz7EfMZeUxxEpWgd+aKlyCr1cc9qglJgJK6bHc9Dcf7o3TiQF43WOqSufjDvfWAcjrU2oITprY2roO/fAFyBY231LE1dBsk7ngb+WAdj2Q9cg2N97NHvJFS+fa9avmMbMAzHWhTvgzUjTNqZqJTdlrUQQfOACThbl8Pt8b7/Th/XqjJW6MDGdt9aLWZCpFF/Ha5sX8MxrQBuxrHyffp9klYb3WvQfgR4HXjE99cb65xs1fEWqG+8RsShxzeicsqnsvf7TZSNqem7QWV2TMY7nHtYGz2P41iHArebbqficg8wJg6DcoNSQe5UnKxIgL43RqUo3+1jYVfGPlQY+QVKJqwh8nmNKau9KFZfiQxAxbS7aQs1WTv6O3R062vgX+CuC5xbHezdzVFJ/JdrKbNbewXTYu5mf9LDuPQF+qNy1DvpReXq4E6BtqIXkNRsETsuq0nfT0J9u3WZDrq01Lu3UG+Kr4DPcfmEYutwXUzX/wHhgdEfu59LwAAAAABJRU5ErkJggg==",alt:"Elisa",wrapped:!0});default:return null}},Qe=function(e){var t=e.feature,n=e.current,a=e.compareTo,i=e.suffix,s=e.unlimitedDataCurrent,c=e.unlimitedDataOffer;return Object(r.jsxs)("div",{className:"offerCardLine compareLine",children:["Tarjouksen pituus"===t||"Lahjakortti"===t||"Ei m\xe4\xe4r\xe4aikaa"===t?Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)("div",{className:"compareItem",children:" "}),Object(r.jsx)("span",{style:{borderBottom:"0"}})]}):Object(r.jsxs)(r.Fragment,{children:[Object(r.jsxs)("div",{className:"compareItem left ".concat("object"===typeof n&&"center"),children:[n,Object(r.jsxs)("span",{className:"small",children:[" ","Rajaton"!==n&&"object"!==typeof n&&i]})]}),Object(r.jsx)("span",{})]}),Object(r.jsx)("p",{children:t}),Object(r.jsx)("span",{}),Object(r.jsxs)("div",{className:"compareItem ".concat("object"===typeof a&&"center"),children:[a,Object(r.jsxs)("span",{className:"small",children:[" ","Rajaton"!==a&&i]})]}),function(){switch(t){case"Puhe":case"Viestit":return"Rajaton"!==n&&("Rajaton"===a||a>n);case"Nettinopeus":case"Eu data":return a>n;case"Norm. hinta":return a<=n;case"Tarjoushinta":return"object"===typeof n||a<=n;case"Lahjakortti":return!0;case"Rajaton netti":return!s&&!!c;case"Ei m\xe4\xe4r\xe4aikaa":return!0;default:return!1}}()?Object(r.jsx)(M.a,{name:"star",color:"yellow"}):Object(r.jsx)(M.a,{})]})},Ne=function(e){var t=e.currentSub,n=e.offerSub,a=e.currentSubOffer,i=e.handleManualOffer,s=e.shoppingCart;return Object(r.jsx)(r.Fragment,{children:Object(r.jsxs)("div",{className:"compereRowContainer ".concat(s&&"shoppingCartOfferTable"),children:[Object(r.jsxs)("div",{className:"compareHeader",children:[Object(r.jsxs)("div",{className:"flexColumn",children:[Object(r.jsx)(Ee,{operator:t.operator.name}),Object(r.jsx)(N.a,{as:"h3",children:t.name})]}),Object(r.jsx)("span",{}),Object(r.jsxs)("div",{className:"flexColumn",children:[Object(r.jsx)(Ee,{operator:n.operator.name}),Object(r.jsx)(N.a,{as:"h3",children:n.name})]})]}),Object(r.jsx)(Qe,{feature:"Puhe",suffix:"min",current:t.talk,compareTo:n.talk}),Object(r.jsx)(Qe,{feature:"Viestit",suffix:"kpl",current:t.sms,compareTo:n.sms}),Object(r.jsx)(Qe,{feature:"Nettinopeus",suffix:"Mbit/s",current:t.speed,compareTo:n.speed}),Object(r.jsx)(Qe,{feature:"Rajaton netti",current:Object(r.jsx)(Ae,{value:t.unlimited}),compareTo:Object(r.jsx)(Ae,{value:n.unlimited}),unlimitedDataCurrent:t.unlimited,unlimitedDataOffer:n.unlimited}),Object(r.jsx)(Qe,{feature:"Eu data",suffix:"Gt/kk",current:t.eu,compareTo:n.eu}),Object(r.jsx)(Qe,{feature:"Norm. hinta",suffix:"\u20ac/kk",current:t.price,compareTo:n.price}),Object(r.jsx)(Qe,{feature:"Tarjoushinta",suffix:"\u20ac/kk",current:a||Object(r.jsx)(Ae,{value:!1}),compareTo:n.offer}),Object(r.jsx)(Qe,{feature:"Tarjouksen pituus",suffix:"kk".concat(n.bindingOffer?"*":""),compareTo:n.offerLength}),n.bindingOffer?null:Object(r.jsx)(Qe,{feature:"Ei m\xe4\xe4r\xe4aikaa",compareTo:Object(r.jsx)(Ae,{value:!0})}),parseInt(n.oneTimeDiscount)?Object(r.jsx)(Qe,{feature:"Lahjakortti",suffix:"\u20ac",compareTo:n.oneTimeDiscount}):i&&i()]})})},Fe=(new D.c).shape({subscription:D.d().required("Liittym\xe4tyyppi\xe4 ei valittu"),validOffer:D.a(),currentOffer:D.b().when("validOffer",{is:!0,then:D.b().required("Tarjoushinta puuttuu"),otherwise:D.b().notRequired()})}),Te=function(e){var t=e.operators,n=e.subscriptions,a=e.handleSelect,s=e.handleClose,c=Object(i.useState)(),o=Object(u.a)(c,2),l=o[0],j=o[1];return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(ke.a.Header,{children:Object(r.jsxs)("div",{className:"flexRow",children:[Object(r.jsx)("div",{className:"offerModalHeader",children:"Valitse nykyinen liittym\xe4"}),Object(r.jsx)(I.a,{className:"closeButton",onClick:s,icon:"x"})]})}),Object(r.jsxs)(ke.a.Content,{children:[Object(r.jsx)(F.a,{children:Object(r.jsx)(F.a.Field,{children:t.map((function(e){return Object(r.jsx)(I.a,{onClick:function(){return j(e.name)},className:"selectedOperatorButton \n                  ".concat(l===e.name?"selectedOperatorButtonActive":"","\n                "),children:Object(r.jsx)(Ee,{operator:e.name})},e.id)}))})}),Object(r.jsx)(L.a,{initialValues:{subscription:void 0,validOffer:!0,currentOffer:""},validationSchema:Fe,onSubmit:function(e){a(e.subscription,e.currentOffer)},children:function(e){return Object(r.jsxs)(F.a,{onSubmit:e.handleSubmit,id:"currentSubscriptionForm",children:[Object(r.jsxs)(F.a.Field,{children:[Object(r.jsxs)(F.a.Field,{label:"Valitse liittym\xe4tyyppi",name:"subscription",control:"select",disabled:!l,onChange:e.handleChange,onBlur:e.handleBlur,children:[Object(r.jsx)("option",{}),n.filter((function(e){return e.operator.name===l})).map((function(e){return Object(r.jsx)("option",{value:e.id,children:e.name},e.id)}))]}),e.errors.subscription&&Object(r.jsx)(T.a,{pointing:!0,color:"yellow",children:e.errors.subscription})]}),Object(r.jsx)(Be,{id:"validOffer",name:"validOffer",label:"Onko tarjous voimassa?",checked:!0===e.values.validOffer,onChange:e.handleChange,disabled:!e.values.subscription}),Object(r.jsx)(ve,{label:"Nykyinen tarjoushinta",placeholder:"Nykyinen tarjoushinta",type:"number",name:"currentOffer",disabled:!e.values.validOffer,onChange:e.handleChange,onBlur:e.handleBlur,error:e.errors.currentOffer,touched:e.touched.currentOffer})]})}})]}),Object(r.jsx)(ke.a.Actions,{children:Object(r.jsx)(I.a,{type:"submit",form:"currentSubscriptionForm",content:"Vertailuun",labelPosition:"right",icon:"checkmark",positive:!0})})]})},Ie=function(e){var t=e.offerSub,n=e.handleClose,s=e.handleShoppingCart,c=Object(j.useQuery)(se),o=c.data,d=c.loading,b=c.error,h=Object(j.useQuery)(de),O=Object(i.useState)(),m=Object(u.a)(O,2),f=m[0],p=m[1],x=Object(i.useState)(),A=Object(u.a)(x,2),w=A[0],g=A[1],v=Object(i.useState)(1),B=Object(u.a)(v,2),C=B[0],k=B[1],y=Object(i.useState)(!1),S=Object(u.a)(y,2),L=S[0],D=S[1];if(d||h.loading)return Object(r.jsx)(we,{});if(b||h.error)return Object(r.jsx)(ge,{error:b});var E=Object(l.a)(o.allSubscriptions).filter((function(e){return e.operator.name!==t.operator.name})),Q=Object(l.a)(h.data.allOperators).filter((function(e){return e.name!==t.operator.name}));return f?Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(ke.a.Header,{children:Object(r.jsxs)("div",{className:"flexRow",children:[Object(r.jsx)(N.a,{className:"offerModalHeader",children:"Liittym\xe4vertailu"}),Object(r.jsx)(I.a,{className:"closeButton",onClick:n,icon:"x"})]})}),Object(r.jsx)(ke.a.Content,{children:Object(r.jsx)(Ne,{currentSub:f,offerSub:t,currentSubOffer:w,handleManualOffer:function(){return"string"===typeof L?Object(r.jsx)(Qe,{feature:"Lahjakortti",compareTo:Object(r.jsx)(pe.a,{fluid:!0,type:"text",value:L,onChange:function(e){var t=e.target.value;if(t.length>2)return null;(/^[0-9]+$/g.test(t)||""===t)&&D(t)}})}):Object(r.jsx)(I.a,{icon:"add",onClick:function(){return D("0")}})}})}),Object(r.jsxs)(ke.a.Actions,{className:"flexRow",children:[Object(r.jsx)(I.a,{onClick:function(){p(),g()},children:"Vaihda nykyist\xe4 liittym\xe4\xe4"}),Object(r.jsx)(Ce,{action:function(e){C<1?k(1):"ADD"===e?k(C+1):"SUBTRACT"===e?C>1&&k(C-1):console.log("wrong input in handleAmount")},amount:C}),Object(r.jsx)(I.a,{content:"Lis\xe4\xe4 koriin",labelPosition:"right",icon:"plus",positive:!0,onClick:function(){var e={id:t.id.concat(f.id),offer:L?Object(a.a)(Object(a.a)({},t),{},{oneTimeDiscount:L}):t,current:w?Object(a.a)(Object(a.a)({},f),{},{offer:w}):f,amount:C};s("ADD",e),n()}})]})]}):Object(r.jsx)(Te,{operators:Q,subscriptions:E,handleSelect:function(e,t){p(E.filter((function(t){return e===t.id}))[0]),t&&g(t.toFixed(2))},handleClose:n})},Me=n(229),Re=n(290),Ue=n(285),Ve=function(e){var t=e.sub,n=Object(Me.a)(e,["sub"]);return Object(r.jsx)("div",Object(a.a)(Object(a.a)({},n),{},{children:Object(r.jsxs)(Re.a,{raised:!0,className:"offerCard",children:[Object(r.jsx)("div",{className:"offerCardLogo",children:Object(r.jsx)(Ee,{operator:t.operator.name,size:"medium"})}),Object(r.jsxs)(Re.a.Content,{children:[Object(r.jsx)(Re.a.Header,{children:t.name}),Object(r.jsx)(Ue.a,{}),Object(r.jsxs)(Re.a.Description,{children:[Object(r.jsxs)("div",{className:"offerCardLine",children:[Object(r.jsx)("p",{children:"Tarjous:"}),Object(r.jsx)("span",{}),Object(r.jsxs)("p",{children:[t.offer,Object(r.jsx)("span",{className:"small",children:"\u20ac/kk"})]})]}),0!==t.oneTimeDiscount&&Object(r.jsxs)("div",{className:"offerCardLine",children:[Object(r.jsx)("p",{children:"Lahjakortti:"}),Object(r.jsx)("span",{}),Object(r.jsxs)("p",{children:[t.oneTimeDiscount,Object(r.jsx)("span",{className:"small",children:"\u20ac"})]})]}),Object(r.jsxs)("div",{className:"offerCardLine",children:[Object(r.jsx)("p",{children:"Pituus:"}),Object(r.jsx)("span",{}),Object(r.jsxs)("p",{children:[t.offerLength,Object(r.jsxs)("span",{className:"small",children:["kk",t.bindingOffer&&"*"]})]})]}),!t.bindingOffer&&Object(r.jsxs)("div",{className:"offerCardLine",children:[Object(r.jsx)("p",{children:"Ei m\xe4\xe4r\xe4aikaa:"}),Object(r.jsx)("span",{}),Object(r.jsx)(Ae,{value:!0})]})]})]}),Object(r.jsx)(Re.a.Content,{extra:!0,children:t.bindingOffer&&Object(r.jsx)("p",{children:"* m\xe4\xe4r\xe4aikainen sopimus"})})]})}))},Pe=function(e){var t=e.feature,n=e.value,a=e.suffix,i={};switch(t){case"Tarjous":i={fontSize:"2.5em"};break;case"Norm. hinta":i={textDecoration:"line-through",color:"grey"};break;case"Lahjakortti":i={fontSize:"2.5em"}}return Object(r.jsxs)("div",{className:"offerCardLine",children:[Object(r.jsx)("p",{children:t}),Object(r.jsx)("span",{}),Object(r.jsxs)("p",{style:i,children:[n,Object(r.jsxs)("span",{className:"small",children:[" ",a]})]})]})},He=function(e){var t=e.subRef;return Object(r.jsxs)("div",{className:"subscriptionDetailContainer",children:[Object(r.jsxs)("div",{children:[Object(r.jsx)(Pe,{feature:"Puhe",value:t.talk,suffix:"Rajaton"!==t.talk&&"min"}),Object(r.jsx)(Pe,{feature:"Viestit",value:t.sms,suffix:"Rajaton"!==t.sms&&"kpl"}),Object(r.jsx)(Pe,{feature:"Nettinopeus",value:t.speed,suffix:"Mbit/s"}),Object(r.jsx)(Pe,{feature:"Rajaton netti",value:Object(r.jsx)(Ae,{value:t.unlimited})}),Object(r.jsx)(Pe,{feature:"EU data",value:t.eu,suffix:"Gt/kk"})]}),Object(r.jsxs)("div",{children:[Object(r.jsx)(Pe,{feature:"Tarjous",value:t.offer,suffix:"\u20ac/kk"}),Object(r.jsx)(Pe,{feature:"Norm. hinta",value:t.price,suffix:"\u20ac/kk"}),t.oneTimeDiscount?Object(r.jsx)(Pe,{feature:"Lahjakortti",value:t.oneTimeDiscount,suffix:"\u20ac"}):null,Object(r.jsx)(Pe,{feature:"Pituus",value:t.offerLength,suffix:"kk".concat(t.bindingOffer?"*":"")}),!t.bindingOffer&&Object(r.jsx)(Pe,{feature:"Ei m\xe4\xe4r\xe4aikaa",value:Object(r.jsx)(Ae,{value:!0})})]})]})},We=function(e){var t=e.subRef,n=e.handleShoppingCart,a=Object(i.useState)(!1),s=Object(u.a)(a,2),c=s[0],o=s[1],l=Object(i.useState)(!1),j=Object(u.a)(l,2),d=j[0],b=j[1];return Object(r.jsx)(ke.a,{onClose:function(){return o(!1)},onOpen:function(){o(!0),b(!1)},open:c,trigger:Object(r.jsx)(Ve,{sub:t}),children:d?Object(r.jsx)(Ie,{offerSub:t,handleClose:function(){o(!1)},handleShoppingCart:n}):Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(ke.a.Header,{children:Object(r.jsxs)("div",{className:"flexRow",children:[Object(r.jsxs)("div",{className:"offerModalHeader",children:[Object(r.jsx)(Ee,{operator:t.operator.name})," ",Object(r.jsx)("span",{style:{paddingLeft:"2em"},children:t.name})]}),Object(r.jsx)(I.a,{className:"closeButton",onClick:function(){return o(!1)},icon:"x"})]})}),Object(r.jsx)(ke.a.Content,{children:Object(r.jsx)(ke.a.Description,{children:Object(r.jsx)(He,{subRef:t})})}),Object(r.jsx)(ke.a.Actions,{children:Object(r.jsx)(I.a,{content:"Vertailu",labelPosition:"right",icon:"checkmark",onClick:function(){return b(!0)},positive:!0})})]})})},Ye=function(e){var t=e.handleShoppingCart,n=Object(j.useQuery)(ce),a=n.data,i=n.loading,s=n.error;if(i)return Object(r.jsx)(we,{});if(s)return Object(r.jsx)(ge,{error:s});var c=Object(l.a)(a.allSubscriptionsWithOffer).sort((function(e,t){return t.offerValue-e.offerValue}));return Object(r.jsx)("div",{className:"offerContainer",children:c.map((function(e){return Object(r.jsx)(We,{subRef:e,handleShoppingCart:t},e.id)}))})},Ge=(new D.c).shape({id:D.d().required("Valitse liittym\xe4n nimi"),offer:D.b().required("Sy\xf6t\xe4 tarjoushinta"),offerLength:D.b().required("Sy\xf6t\xe4 tarjouksen pituus"),oneTimeDiscount:D.b(),offerValue:D.b().min(0).max(5).required("Valitse tarjouksen luokka")}),Ke=function(e){var t=e.handleAddOffer,n=Object(i.useState)(),a=Object(u.a)(n,2),s=a[0],c=a[1],o=Object(j.useQuery)(de),l=Object(j.useQuery)(oe);return o.loading||l.loading?Object(r.jsx)(we,{}):o.error?Object(r.jsx)(ge,{error:o.error}):s?Object(r.jsx)(L.a,{initialValues:{id:void 0,offer:"",offerLength:12,bindingOffer:!1,oneTimeDiscount:0,offerValue:3},validationSchema:Ge,onSubmit:function(e){e.offerLength=parseInt(e.offerLength),e.offerValue=parseInt(e.offerValue),t(e)},children:function(e){return Object(r.jsxs)(F.a,{onSubmit:e.handleSubmit,id:"addOfferForm",children:[Object(r.jsxs)(F.a.Field,{name:"id",label:"Valse liittym\xe4",control:"select",onChange:e.handleChange,onBlur:e.handleBlur,children:[Object(r.jsx)("option",{}),l.data.allActiveSubscriptions.filter((function(e){return s===e.operator.id&&!0!==e.hasOffer})).map((function(e){return Object(r.jsx)("option",{value:e.id,children:e.name},e.id)}))]}),e.touched.id&&e.errors.id?Object(r.jsx)(T.a,{pointing:!0,color:"yellow",children:e.errors.id}):null,Object(r.jsx)(ve,{label:"Tarjoushinta",disabled:!e.values.id,name:"offer",type:"text",onChange:e.handleChange,onBlur:e.handleBlur,error:e.errors.offer,touched:e.touched.offer}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsxs)(F.a.Field,{disabled:!e.values.id,name:"offerLength",label:"Tarjouksen kesto (kk)",control:"select",onChange:e.handleChange,onBlur:e.handleBlur,children:[Object(r.jsx)("option",{value:"12",children:"12"}),Object(r.jsx)("option",{value:"24",children:"24"})]}),Object(r.jsx)(Be,{disabled:!e.values.id,id:"bindingOffer",name:"bindingOffer",label:"M\xe4\xe4r\xe4aika",checked:!0===e.values.bindingOffer,onChange:e.handleChange})]}),Object(r.jsx)(ve,{label:"Alennus",disabled:!e.values.id,name:"oneTimeDiscount",type:"number",onChange:e.handleChange,onBlur:e.handleBlur,error:e.errors.oneTimeDiscount,touched:e.touched.oneTimeDiscount}),Object(r.jsxs)(F.a.Field,{disabled:!e.values.id,name:"offerValue",label:"Tarjouksen arvo",control:"select",onChange:e.handleChange,onBlur:e.handleBlur,children:[Object(r.jsx)("option",{value:"1",children:"1"}),Object(r.jsx)("option",{value:"2",children:"2"}),Object(r.jsx)("option",{value:"3",children:"3"}),Object(r.jsx)("option",{value:"4",children:"4"}),Object(r.jsx)("option",{value:"5",children:"5"})]})]})}}):Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(N.a,{as:"h2",children:"Valitse operaattori"}),o.data.allOperators.map((function(e){return Object(r.jsx)(I.a,{style:{backgroundColor:"white"},value:e.id,onClick:function(){return c(e.id)},children:Object(r.jsx)(Ee,{operator:e.name})},e.id)}))]})},qe=function(){var e=Object(i.useState)(!1),t=Object(u.a)(e,2),n=t[0],s=t[1],c=Object(j.useMutation)(be),o=Object(u.a)(c,1)[0],d=function(){var e=Object(O.a)(h.a.mark((function e(t){var n;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o({variables:Object(a.a)({},t),update:function(e,t){var n=t.data;e.modify({fields:{allSubscriptionsWithOffer:function(e){return[].concat(Object(l.a)(e),[n.addOffer])}}})}});case 3:return n=e.sent,s(!1),e.abrupt("return",n);case 8:e.prev=8,e.t0=e.catch(0),window.alert(e.t0),s(!1);case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}();return Object(r.jsxs)(ke.a,{onClose:function(){return s(!1)},onOpen:function(){return s(!0)},open:n,trigger:Object(r.jsx)(I.a,{positive:!0,children:"Lis\xe4\xe4 tarjous"}),children:[Object(r.jsx)(ke.a.Header,{children:"Lis\xe4\xe4 tarjous"}),Object(r.jsx)(ke.a.Content,{children:Object(r.jsx)(Ke,{handleAddOffer:d})}),Object(r.jsxs)(ke.a.Actions,{children:[Object(r.jsx)(I.a,{content:"Peruuta",icon:"x",labelPosition:"right",color:"black",onClick:function(){return s(!1)}}),Object(r.jsx)(I.a,{type:"submit",form:"addOfferForm",content:"Tallenna",labelPosition:"right",icon:"checkmark",positive:!0})]})]})},ze=n(289),Je=function(e){var t=e.operator,n=e.subscriptions,a=Object(j.useMutation)(he),i=Object(u.a)(a,1)[0],s=function(){var e=Object(O.a)(h.a.mark((function e(t,n){var a;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.id,window.confirm("Haluatko varmasti poistaa tarjouksen?")){e.next=3;break}return e.abrupt("return",null);case 3:return e.prev=3,e.next=6,i({variables:{id:a},update:function(e,t){var n=t.data,a=e.identify(n.removeOffer);e.modify({fields:{allSubscriptionsWithOffer:function(e){return e.filter((function(e){return a!==(e.__ref||"Subscription:".concat(e.id))}))}}})}});case 6:return e.abrupt("return",e.sent);case 9:e.prev=9,e.t0=e.catch(3),window.alert(e.t0);case 12:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n){return e.apply(this,arguments)}}();return Object(r.jsxs)("div",{className:"offerContainer",children:[Object(r.jsx)(Ee,{operator:t}),Object(r.jsxs)(ze.a,{celled:!0,selectable:!0,children:[Object(r.jsx)(ze.a.Header,{children:Object(r.jsx)(ze.a.Row,{children:["Nimi","Tarjoushinta","Alennus","Pituus(kk)","M\xe4\xe4r\xe4aika","Luokka","Poista"].map((function(e){return Object(r.jsx)(ze.a.HeaderCell,{children:e},e)}))})}),Object(r.jsx)(ze.a.Body,{children:n.filter((function(e){return e.operator.name===t})).map((function(e){return Object(r.jsxs)(ze.a.Row,{children:[Object(r.jsx)(ze.a.Cell,{children:e.name}),Object(r.jsx)(ze.a.Cell,{children:e.offer}),Object(r.jsx)(ze.a.Cell,{children:e.oneTimeDiscount}),Object(r.jsx)(ze.a.Cell,{children:e.offerLength}),Object(r.jsx)(ze.a.Cell,{children:Object(r.jsx)(Ae,{value:e.bindingOffer})}),Object(r.jsx)(ze.a.Cell,{children:e.offerValue}),Object(r.jsx)(ze.a.Cell,{children:Object(r.jsx)(I.a,{id:e.id,name:e.name,color:"red",onClick:s,children:Object(r.jsx)(M.a,{name:"delete"})})})]},e.id)}))})]})]})},Ze=function(){var e=Object(j.useQuery)(ce),t=e.data,n=e.error;return e.loading?Object(r.jsx)(we,{}):n?Object(r.jsx)(ge,{error:n}):Object(r.jsxs)("div",{className:"tableContainer",children:[Object(r.jsx)(N.a,{as:"h2",children:"Tarjoukset"}),Object(r.jsx)(qe,{}),Object(r.jsx)(Je,{operator:"Dna",subscriptions:t.allSubscriptionsWithOffer}),Object(r.jsx)(Je,{operator:"Elisa",subscriptions:t.allSubscriptionsWithOffer}),Object(r.jsx)(Je,{operator:"Telia",subscriptions:t.allSubscriptionsWithOffer})]})},Xe=n(286),$e=(new D.c).shape({name:D.d().min(4,"Liian lyhyt nimi").required("Nimi puuttuu"),talk:D.b().required("Puhem\xe4\xe4r\xe4 puuttuu"),sms:D.b().required("Viesim\xe4\xe4r\xe4 puuttuu"),speed:D.b().required("Nettinopeus puuttuu"),unlimited:D.a().required("M\xe4\xe4rit\xe4 onko netti rajaton vai ei"),eu:D.b().required("Eu data puuttuu"),active:D.a().required("Onko liittym\xe4 ahtiivinen vai ei"),price:D.b().required("Kuukausimaksu puuttuu")}),_e=function(e){var t=e.selectedOperator,n=e.setSelectedOperator,a=e.handleAddSubscription,i=Object(j.useQuery)(de);if(i.loading)return null;if(!t)return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(N.a,{as:"h2",children:"Valitse operaattori"}),i.data.allOperators.map((function(e){return Object(r.jsx)(I.a,{style:{backgroundColor:"white"},value:e.id,onClick:function(){return n(e.id)},children:Object(r.jsx)(Ee,{operator:e.name})},e.id)}))]});var s=function(e){return e?Object(r.jsx)(T.a,{pointing:!0,color:"yellow",children:e}):null};return Object(r.jsx)(L.a,{initialValues:{name:"",talk:0,talkUnlimited:!0,sms:0,smsUnlimited:!0,speed:void 0,unlimited:!0,eu:void 0,active:!0,price:void 0},validationSchema:$e,onSubmit:function(){var e=Object(O.a)(h.a.mark((function e(n){return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.talkUnlimited?n.talk="Rajaton":n.talk=String(n.talk),n.smsUnlimited?n.sms="Rajaton":n.sms=String(n.sms),n.price=String(n.price),n.speed=String(n.speed),a({operator:t,name:n.name,talk:n.talk,sms:n.sms,speed:n.speed,unlimited:n.unlimited,eu:n.eu,active:n.active,price:n.price});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:function(e){return Object(r.jsxs)(F.a,{onSubmit:e.handleSubmit,id:"addSubscription",children:[Object(r.jsx)(N.a,{children:Object(r.jsx)(Ee,{operator:i.data.allOperators.find((function(e){return e.id===t})).name})}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsxs)("div",{children:[Object(r.jsx)(F.a.Input,{type:"text",onBlur:e.handleBlur,onChange:e.handleChange,name:"name",label:"Liittym\xe4n nimi",placeholder:"Nimi"}),e.touched.name&&s(e.errors.name)]}),Object(r.jsxs)(F.a.Group,{className:"radioLabelGroup",children:[Object(r.jsx)(F.a.Field,{label:"Aktiivinen"}),Object(r.jsx)(xe.a,{id:"active",type:"checkbox",toggle:!0,name:"active",checked:!0===e.values.active,onChange:e.handleChange})]})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsxs)("div",{children:[Object(r.jsx)(F.a.Input,{type:"number",onChange:e.handleChange,onBlur:e.handleBlur,name:"talk",label:"Puheaika",placeholder:"Puheaika"}),!e.values.talkUnlimited&&e.touched.talk&&s(e.errors.talk)]}),Object(r.jsxs)(F.a.Group,{className:"radioLabelGroup",children:[Object(r.jsx)(F.a.Field,{label:"Rajaton puhe"}),Object(r.jsx)(xe.a,{id:"talkUnlimited",type:"checkbox",toggle:!0,name:"talkUnlimited",checked:!0===e.values.talkUnlimited,onChange:e.handleChange})]})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsxs)("div",{children:[Object(r.jsx)(F.a.Input,{type:"number",onChange:e.handleChange,onBlur:e.handleBlur,name:"sms",label:"Viesim\xe4\xe4r\xe4",placeholder:"Viesim\xe4\xe4r\xe4"}),!e.values.smsUnlimited&&e.touched.sms&&s(e.errors.sms)]}),Object(r.jsxs)(F.a.Group,{className:"radioLabelGroup",children:[Object(r.jsx)(F.a.Field,{label:"Rajaton sms"}),Object(r.jsx)(xe.a,{id:"smsUnlimited",type:"checkbox",toggle:!0,name:"smsUnlimited",checked:!0===e.values.smsUnlimited,onChange:e.handleChange})]})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsxs)("div",{children:[Object(r.jsx)(F.a.Input,{type:"text",onChange:e.handleChange,onBlur:e.handleBlur,name:"speed",label:"Nettinopeus",placeholder:"Nettinopeus"}),e.touched.speed&&s(e.errors.speed)]}),Object(r.jsxs)(F.a.Group,{className:"radioLabelGroup",children:[Object(r.jsx)(F.a.Field,{label:"Rajaton netti"}),Object(r.jsx)(xe.a,{id:"unlimited",type:"checkbox",toggle:!0,name:"unlimited",checked:!0===e.values.unlimited,onChange:e.handleChange})]})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsxs)("div",{children:[Object(r.jsx)(F.a.Input,{type:"number",onChange:e.handleChange,onBlur:e.handleBlur,name:"eu",label:"Eu data",placeholder:"Eu data"}),e.touched.eu&&s(e.errors.eu)]}),Object(r.jsxs)("div",{children:[Object(r.jsx)(F.a.Input,{type:"text",onChange:e.handleChange,onBlur:e.handleBlur,name:"price",label:"Kuukausimaksu",placeholder:"Kuukausimaksu"}),e.touched.price&&s(e.errors.price)]})]})]})}})},et=function(){var e=Object(i.useState)(!1),t=Object(u.a)(e,2),n=t[0],a=t[1],s=Object(i.useState)(),c=Object(u.a)(s,2),o=c[0],d=c[1],b=Object(j.useMutation)(le),m=Object(u.a)(b,1)[0],f=function(){var e=Object(O.a)(h.a.mark((function e(t){var n,r,i,s,c,o,u,j,d;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.operator,r=t.name,i=t.talk,s=t.sms,c=t.speed,o=t.unlimited,u=t.eu,j=t.active,d=t.price,e.prev=1,e.next=4,m({variables:{operator:n,name:r,talk:i,sms:s,speed:c,unlimited:o,eu:u,active:j,price:d},update:function(e,t){var n=t.data;e.modify({fields:{allSubscriptions:function(e){return[].concat(Object(l.a)(e),[n.addSubscription])}}})}});case 4:a(!1),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),window.alert(e.t0.message),a(!1);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}();return Object(r.jsxs)(ke.a,{onClose:function(){return a(!1)},onOpen:function(){return a(!0)},open:n,trigger:Object(r.jsx)(I.a,{children:"Lis\xe4\xe4 liittym\xe4"}),children:[Object(r.jsx)(ke.a.Header,{children:"Lis\xe4\xe4 liittym\xe4"}),Object(r.jsx)(ke.a.Content,{children:Object(r.jsx)(_e,{closeModal:function(){a(!1)},selectedOperator:o,setSelectedOperator:d,handleAddSubscription:f})}),Object(r.jsxs)(ke.a.Actions,{children:[Object(r.jsx)(I.a,{color:"black",onClick:function(){return a(!1)},children:"Peruuta"}),Object(r.jsx)(I.a,{onClick:function(){return d()},children:"Vaihda operaattoria"}),Object(r.jsx)(I.a,{type:"submit",form:"addSubscription",content:"Lis\xe4\xe4",labelPosition:"right",icon:"checkmark",positive:!0})]})]})},tt=(new D.c).shape({name:D.d().min(4,"Liian lyhyt nimi").required("Nimi puuttuu"),talk:D.b().required("Puhem\xe4\xe4r\xe4 puuttuu"),sms:D.b().required("Viesim\xe4\xe4r\xe4 puuttuu"),speed:D.b().required("Nettinopeus puuttuu"),unlimited:D.a().required("M\xe4\xe4rit\xe4 onko netti rajaton vai ei"),eu:D.b().required("Eu data puuttuu"),active:D.a().required("Onko liittym\xe4 ahtiivinen vai ei"),price:D.b().required("Kuukausimaksu puuttuu")}),nt=function(e){var t=e.subRef,n=e.handleEditSub;return Object(r.jsx)(L.a,{initialValues:{name:t.name,talk:"Rajaton"===t.talk?0:t.talk,talkUnlimited:"Rajaton"===t.talk,sms:"Rajaton"===t.sms?0:t.sms,smsUnlimited:"Rajaton"===t.sms,speed:t.speed,unlimited:t.unlimited,eu:t.eu,active:t.active,price:t.price},validationSchema:tt,onSubmit:function(e){n({id:t.id,name:e.name,talk:e.talkUnlimited?"Rajaton":String(e.talk),sms:e.smsUnlimited?"Rajaton":String(e.sms),speed:String(e.speed),unlimited:e.unlimited,eu:e.eu,active:e.active,price:String(e.price)})},children:function(e){return Object(r.jsxs)(F.a,{onSubmit:e.handleSubmit,id:"editSubscriptionForm",children:[Object(r.jsxs)(F.a.Group,{children:[Object(r.jsx)(ve,{label:"Nimi",name:"name",type:"text",onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.name,error:e.errors.name,touched:e.touched.name}),Object(r.jsx)(Be,{label:"Aktiivinen",id:"active",name:"active",checked:!0===e.values.active,onChange:e.handleChange})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsx)(ve,{label:"Puheaika",name:"talk",type:"number",disabled:!!e.values.talkUnlimited,onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.talk,error:!e.values.talkUnlimited&&e.errors.talk,touched:e.touched.talk}),Object(r.jsx)(Be,{label:"Rajaton puhe",id:"talkUnlimited",name:"talkUnlimited",checked:!0===e.values.talkUnlimited,onChange:e.handleChange})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsx)(ve,{label:"Viestej\xe4",name:"sms",type:"number",disabled:!!e.values.smsUnlimited,onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.sms,error:!e.values.smsUnlimited&&e.errors.sms,touched:e.touched.sms}),Object(r.jsx)(Be,{label:"Rajattomat viestit",id:"smsUnlimited",name:"smsUnlimited",checked:!0===e.values.smsUnlimited,onChange:e.handleChange})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsx)(ve,{label:"Nettinopeus",name:"speed",type:"number",onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.speed,error:e.errors.speed,touched:e.touched.speed}),Object(r.jsx)(Be,{label:"Rajaton netti",id:"unlimited",name:"unlimited",checked:!0===e.values.unlimited,onChange:e.handleChange})]}),Object(r.jsxs)(F.a.Group,{children:[Object(r.jsx)(ve,{label:"Eu data",name:"eu",type:"number",onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.eu,error:e.errors.eu,touched:e.touched.eu}),Object(r.jsx)(ve,{label:"Hinta",name:"price",type:"number",onChange:e.handleChange,onBlur:e.handleBlur,value:e.values.price,error:e.errors.price,touched:e.touched.price})]})]})}})},at=function(e){var t=Object(i.useState)(!1),n=Object(u.a)(t,2),a=n[0],s=n[1],c=Object(j.useMutation)(ue),o=Object(u.a)(c,1)[0],l=function(){var e=Object(O.a)(h.a.mark((function e(t){var n,a,r,i,c,l,u,j,d;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.id,a=t.name,r=t.talk,i=t.sms,c=t.speed,l=t.unlimited,u=t.eu,j=t.active,d=t.price,e.prev=1,e.next=4,o({variables:{id:n,name:a,talk:r,sms:i,speed:c,unlimited:l,eu:u,active:j,price:d}});case 4:s(!1),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),window.alert(e.t0.message),s(!1);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}();return Object(r.jsxs)(ke.a,{onClose:function(){return s(!1)},onOpen:function(){return s(!0)},open:a,trigger:Object(r.jsx)(I.a,{id:e.subRef.id,onClick:e.handleClick,children:Object(r.jsx)(M.a,{name:"configure"})}),children:[Object(r.jsx)(ke.a.Header,{children:"Muokkaa k\xe4ytt\xe4j\xe4\xe4"}),Object(r.jsx)(ke.a.Content,{children:Object(r.jsx)(nt,{subRef:e.subRef,handleEditSub:l})}),Object(r.jsxs)(ke.a.Actions,{children:[Object(r.jsx)(I.a,{type:"submit",form:"editSubscriptionForm",content:"Tallenna",icon:"checkmark",positive:!0}),Object(r.jsx)(I.a,{content:"Peruuta",icon:"delete",onClick:function(){return s(!1)}})]})]})},rt=function(){var e=Object(j.useQuery)(se),t=e.data,n=e.error,a=e.loading,s=Object(j.useQuery)(de),c=s.data,o=s.error,d=s.loading,b=Object(j.useMutation)(je),m=Object(u.a)(b,1)[0],f=Object(i.useState)(),p=Object(u.a)(f,2),x=p[0],A=p[1],w=Object(i.useState)(),g=Object(u.a)(w,2),v=g[0],B=g[1];if(a||d)return Object(r.jsx)(we,{});if(n||o)return Object(r.jsx)(ge,{error:n});var C=function(){var e=Object(O.a)(h.a.mark((function e(t,n){var a,r;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.id,r=n.name,window.confirm("Poistetaanko liittym\xe4 ".concat(r))){e.next=4;break}return e.abrupt("return",null);case 4:return e.prev=4,e.next=7,m({variables:{id:a},update:function(e,t){var n=t.data,a=e.identify(n.deleteSubscription);e.modify({fields:{allSubscriptions:function(e){return e.filter((function(e){return a!==e.__ref}))}}})}});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),window.alert(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(t,n){return e.apply(this,arguments)}}(),k=Object(l.a)(t.allSubscriptions);return v&&(k=Object(l.a)(k).filter((function(e){return e.operator.name===v}))),k.sort(function(e){switch(e){case"name":return function(e,t){return e.name>t.name?-1:1};default:return function(e,t){return e.operator.name>t.operator.name?1:-1}}}(x)),console.log(k[0].name),Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(N.a,{as:"h2",children:"Liittym\xe4hallinta"}),Object(r.jsx)(et,{}),Object(r.jsxs)(ze.a,{celled:!0,selectable:!0,children:[Object(r.jsx)(ze.a.Header,{children:Object(r.jsxs)(ze.a.Row,{children:[Object(r.jsx)(ze.a.HeaderCell,{children:Object(r.jsx)(Xe.a,{text:"Operaattori",multiple:!0,icon:"filter",children:Object(r.jsxs)(Xe.a.Menu,{children:[Object(r.jsx)(Xe.a.Item,{onClick:function(){return B()},children:"kaikki"}),Object(r.jsx)(Xe.a.Divider,{}),c.allOperators.map((function(e){return Object(r.jsx)(Xe.a.Item,{onClick:function(){return B(e.name)},children:e.name},e.id)}))]})})}),Object(r.jsx)(ze.a.HeaderCell,{children:Object(r.jsx)(Xe.a,{text:"Nimi",icon:"sort",onClick:function(){return x?A():A("name")}})}),Object(r.jsx)(ze.a.HeaderCell,{children:"Puhe"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Viestit"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Nettinopeus"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Rajaton netti"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Eu data"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Aktiivinen"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Vastaavat liittym\xe4t"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Hinta"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Muokkaa"})]})}),Object(r.jsx)(ze.a.Body,{children:k.map((function(e){return Object(r.jsxs)(ze.a.Row,{children:[Object(r.jsxs)(ze.a.Cell,{className:"operatorLogoContainer",children:[Object(r.jsx)(Ee,{operator:e.operator.name})," "]}),Object(r.jsx)(ze.a.Cell,{children:e.name}),Object(r.jsx)(ze.a.Cell,{children:e.talk}),Object(r.jsx)(ze.a.Cell,{children:e.sms}),Object(r.jsx)(ze.a.Cell,{children:e.speed}),Object(r.jsx)(ze.a.Cell,{children:Object(r.jsx)(Ae,{value:e.unlimited})}),Object(r.jsx)(ze.a.Cell,{children:e.eu}),Object(r.jsx)(ze.a.Cell,{children:Object(r.jsx)(Ae,{value:e.active})}),Object(r.jsx)(ze.a.Cell,{children:e.equivelentSub.name}),Object(r.jsx)(ze.a.Cell,{children:e.price}),Object(r.jsxs)(ze.a.Cell,{children:[Object(r.jsx)(at,{subRef:e}),Object(r.jsx)(I.a,{id:e.id,name:e.name,color:"red",onClick:C,children:Object(r.jsx)(M.a,{name:"delete"})})]})]},e.id)}))})]})]})},it=D.c().shape({username:D.d().min(4,"K\xe4ytt\xe4j\xe4nimi liian lyhyt").max(15,"K\xe4ytt\xe4j\xe4nimi liian pitk\xe4").required("K\xe4ytt\xe4j\xe4nimi puuttuu"),name:D.d().min(4,"Nimi liian lyhyt").max(15,"Nimi liian pitk\xe4").required("Nimi puuttuu"),password:D.d().min(8,"Salasana liian lyhyt").required("Salasana puuttuu"),store:D.b().required("Talon numero puuttuu")}),st=function(e){return Object(r.jsx)(L.a,{initialValues:{name:"",username:"",store:"0000",type:"store",password:""},validationSchema:it,onSubmit:function(t){e.handleAddUser(t)},children:function(e){return Object(r.jsxs)(F.a,{onSubmit:e.handleSubmit,children:[Object(r.jsx)(F.a.Input,{type:"text",onChange:e.handleChange,value:e.values.name,name:"name",icon:"tag",iconPosition:"left",label:"Nimi",placeholder:"Nimi"}),e.errors.name&&Object(r.jsx)(T.a,{className:"errorMessage",pointing:!0,color:"yellow",children:e.errors.name}),Object(r.jsx)(F.a.Input,{type:"text",onChange:e.handleChange,value:e.values.username,name:"username",icon:"user",iconPosition:"left",label:"K\xe4ytt\xe4j\xe4nimi",placeholder:"K\xe4ytt\xe4j\xe4nimi"}),e.errors.username&&Object(r.jsx)(T.a,{className:"errorMessage",pointing:!0,color:"yellow",children:e.errors.username}),Object(r.jsx)(F.a.Input,{type:"password",onChange:e.handleChange,value:e.values.password,name:"password",icon:"lock",iconPosition:"left",label:"Salasana",placeholder:"Salasana"}),e.errors.password&&Object(r.jsx)(T.a,{className:"errorMessage",pointing:!0,color:"yellow",children:e.errors.password}),Object(r.jsx)(F.a.Input,{type:"number",onChange:e.handleChange,value:e.values.store,name:"store",icon:"warehouse",iconPosition:"left",label:"Talo"}),e.errors.store&&Object(r.jsx)(T.a,{className:"errorMessage",pointing:!0,color:"yellow",children:e.errors.store}),Object(r.jsxs)(F.a.Field,{label:"Rooli",control:"select",name:"type",onChange:e.handleChange,value:e.values.type,children:[Object(r.jsx)("option",{value:"admin",children:"admin"}),Object(r.jsx)("option",{value:"storeAdmin",children:"storeAdmin"}),Object(r.jsx)("option",{value:"store",children:"store"})]}),e.errors.type&&Object(r.jsx)(T.a,{className:"errorMessage",pointing:!0,color:"yellow",children:e.errors.type}),Object(r.jsx)(I.a,{type:"submit",positive:!0,children:"Lis\xe4\xe4"})]})}})},ct=function(){var e=Object(i.useState)(!1),t=Object(u.a)(e,2),n=t[0],a=t[1],s=Object(j.useMutation)(k),c=Object(u.a)(s,1)[0],o=function(){var e=Object(O.a)(h.a.mark((function e(t){var n,r,i,s,o;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.name,r=t.username,i=t.store,s=t.type,o=t.password,e.prev=1,e.next=4,c({variables:{name:n,username:r,store:i,type:s,password:o},update:function(e,t){var n=t.data;e.modify({fields:{allUsers:function(e){return[].concat(Object(l.a)(e),[n.addUser])}}})}});case 4:a(!1),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),window.alert(e.t0.message),a(!1);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}();return Object(r.jsxs)(ke.a,{onClose:function(){return a(!1)},onOpen:function(){return a(!0)},open:n,trigger:Object(r.jsx)(I.a,{children:"Lis\xe4\xe4 k\xe4ytt\xe4j\xe4"}),children:[Object(r.jsx)(ke.a.Header,{children:"Lis\xe4\xe4 k\xe4ytt\xe4j\xe4"}),Object(r.jsx)(ke.a.Content,{children:Object(r.jsx)(st,{handleAddUser:o})}),Object(r.jsx)(ke.a.Actions,{children:Object(r.jsx)(I.a,{content:"Peruuta",icon:"delete",onClick:function(){return a(!1)}})})]})},ot=function(e){return Object(r.jsx)(L.a,{initialValues:{name:e.user.name,type:e.user.type,store:e.user.store,id:e.user.id},onSubmit:function(t){e.handleModify(t),e.modalOpen(!1)},children:function(e){return Object(r.jsxs)(F.a,{onSubmit:e.handleSubmit,children:[Object(r.jsxs)(F.a.Field,{children:[Object(r.jsx)("label",{children:"Nimi"}),Object(r.jsx)("input",{name:"name",type:"text",onChange:e.handleChange,value:e.values.name})]}),Object(r.jsxs)(F.a.Field,{children:[Object(r.jsx)("label",{children:"Talo"}),Object(r.jsx)("input",{name:"store",type:"number",onChange:e.handleChange,value:e.values.store})]}),Object(r.jsxs)(F.a.Field,{children:[Object(r.jsx)("label",{children:"Rooli"}),Object(r.jsxs)("select",{name:"type",onChange:e.handleChange,value:e.values.type,children:[Object(r.jsx)("option",{value:"admin",children:"admin"}),Object(r.jsx)("option",{value:"store",children:"store"}),Object(r.jsx)("option",{value:"storeAdmin",children:"storeAdmin"})]})]}),Object(r.jsx)(I.a,{type:"submit",content:"Tallenna",icon:"checkmark",positive:!0})]})}})},lt=function(e){var t=Object(i.useState)(!1),n=Object(u.a)(t,2),a=n[0],s=n[1],c=Object(j.useMutation)(y),o=Object(u.a)(c,1)[0],l=function(){var e=Object(O.a)(h.a.mark((function e(t){return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o({variables:{id:t.id,name:t.name,type:t.type,store:t.store}});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),window.alert(e.t0.message),s(!1);case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}();return Object(r.jsxs)(ke.a,{onClose:function(){return s(!1)},onOpen:function(){return s(!0)},open:a,trigger:Object(r.jsx)(I.a,{id:e.user.id,onClick:e.handleClick,children:Object(r.jsx)(M.a,{name:"configure"})}),children:[Object(r.jsx)(ke.a.Header,{children:"Muokkaa k\xe4ytt\xe4j\xe4\xe4"}),Object(r.jsx)(ke.a.Content,{children:Object(r.jsx)(ot,{user:e.user,modalOpen:s,handleModify:l})}),Object(r.jsx)(ke.a.Actions,{children:Object(r.jsx)(I.a,{content:"Peruuta",icon:"delete",onClick:function(){return s(!1)}})})]})},ut=function(){var e=Object(j.useQuery)(v),t=e.data,n=e.error,a=e.loading,i=Object(j.useQuery)(B),s=Object(j.useMutation)(S),c=Object(u.a)(s,1)[0];if(a||i.loading)return Object(r.jsxs)(Oe.a,{className:"tableContainer",children:[Object(r.jsx)(Oe.a.Line,{}),Object(r.jsx)(Oe.a.Line,{}),Object(r.jsx)(Oe.a.Line,{}),Object(r.jsx)(Oe.a.Line,{}),Object(r.jsx)(Oe.a.Line,{})]});if(n||i.error)return Object(r.jsx)("div",{children:"Virhe"});var o=t.allUsers;"admin"!==i.data.me.type&&(o=t.allUsers.filter((function(e){return i.data.me.store===e.store})));var l=function(){var e=Object(O.a)(h.a.mark((function e(t,n){var a,r,i;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.id,r=n.name,i=n.store,window.confirm("Poistetaanko k\xe4ytt\xe4j\xe4: ".concat(r,"?"))){e.next=4;break}return e.abrupt("return",null);case 4:return e.prev=4,e.next=7,c({variables:{id:a,store:i},update:function(e,t){var n=t.data,a=e.identify(n.deleteUser);e.modify({fields:{allUsers:function(e){return e.filter((function(e){return a!==e.__ref}))}}})}});case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(4),window.alert(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(t,n){return e.apply(this,arguments)}}();return Object(r.jsxs)("div",{className:"tableContainer",children:[Object(r.jsx)(N.a,{as:"h2",children:"K\xe4ytt\xe4j\xe4hallinta"}),Object(r.jsxs)(ze.a,{celled:!0,selectable:!0,children:[Object(r.jsx)(ze.a.Header,{children:Object(r.jsxs)(ze.a.Row,{children:[Object(r.jsx)(ze.a.HeaderCell,{children:"Nimi"}),Object(r.jsx)(ze.a.HeaderCell,{children:"K\xe4ytt\xe4j\xe4nimi"}),Object(r.jsx)(ze.a.HeaderCell,{children:"K\xe4ytt\xe4j\xe4tyyppi"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Talo"}),Object(r.jsx)(ze.a.HeaderCell,{children:"Muokkaa"})]})}),Object(r.jsx)(ze.a.Body,{children:o.map((function(e){return Object(r.jsxs)(ze.a.Row,{children:[Object(r.jsx)(ze.a.Cell,{children:e.name}),Object(r.jsx)(ze.a.Cell,{children:e.username}),Object(r.jsx)(ze.a.Cell,{children:e.type}),Object(r.jsx)(ze.a.Cell,{children:e.store}),Object(r.jsxs)(ze.a.Cell,{children:[Object(r.jsx)(lt,{user:e}),!("admin"===e.type)&&Object(r.jsx)(I.a,{id:e.id,name:e.name,store:e.store,onClick:l,color:"red",children:Object(r.jsx)(M.a,{name:"delete"})})]})]},e.id)}))})]}),Object(r.jsx)(ct,{})]})},jt=function(){var e=Object(i.useState)("tarjous"),t=Object(u.a)(e,2),n=t[0],a=t[1],s=Object(j.useQuery)(B),c=s.data,o=s.loading,l=s.error;if(o)return null;if(l)return Object(r.jsx)("div",{children:"error"});if("store"===c.me.type)return null;var d=function(e,t){var n=t.name;a(n)};return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(H.a,{size:"mini",style:{marginTop:"2px"},children:Object(r.jsxs)(H.a.Menu,{position:"right",children:[Object(r.jsx)(Y,{link:"/admin",name:"liittyma",text:"Liittym\xe4hallinta",handleClick:d}),Object(r.jsx)(Y,{link:"/admin",name:"tarjous",text:"Tarjoukset",handleClick:d}),Object(r.jsx)(Y,{link:"/admin",name:"kayttaja",text:"K\xe4ytt\xe4j\xe4hallinta",handleClick:d})]})}),function(){switch(n){case"tarjous":return Object(r.jsx)(Ze,{});case"kayttaja":return Object(r.jsx)(ut,{});case"liittyma":return Object(r.jsx)(rt,{});default:return}}()]})},dt=function(e){var t=e.shoppingCart,n=function(){var e=0;return t.forEach((function(t){var n=t.current.offer?parseFloat(t.current.offer)-parseFloat(t.offer.offer):parseFloat(t.current.price)-parseFloat(t.offer.offer);e+=parseFloat(n)*t.amount*12})),e.toFixed(2)},a=function(){var e=0;return t.forEach((function(t){e+=t.offer.oneTimeDiscount*t.amount})),e};return Object(r.jsxs)("div",{className:"flexRow offerCardLine shoppingCartCombinedContainer",children:[Object(r.jsx)("div",{children:"Yhteenveto:"}),n()>0&&Object(r.jsxs)("div",{className:"combinedItem",children:["S\xe4\xe4st\xf6\xe4 yhteens\xe4: ",Object(r.jsxs)("div",{children:[n()," ",Object(r.jsx)("span",{className:"small",children:"\u20ac/vuosi"})]})]}),a()>0&&Object(r.jsxs)("div",{className:"combinedItem",children:["Lahjakortteja yhteens\xe4: ",Object(r.jsxs)("div",{children:[a()," ",Object(r.jsx)("span",{className:"small",children:"\u20ac"})]})]}),Object(r.jsxs)("div",{className:"combinedItem",children:["Kuukausimaksut: ",Object(r.jsxs)("div",{children:[function(){var e=0;return t.forEach((function(t){e=parseFloat(e)+parseFloat(t.offer.offer)*t.amount})),e.toFixed(2)}()," ",Object(r.jsx)("span",{className:"small",children:"\u20ac"})]})]})]})},bt=function(e){var t=e.item,n=e.editItemAmount,a=function(e){n(e,t.id)},i=function(){return(parseInt(t.current.offer?t.current.offer:t.current.price)-parseInt(t.offer.offer))*t.amount*12};return Object(r.jsx)(r.Fragment,{children:Object(r.jsxs)("div",{className:"flexRow offerCardLine shoppingCart",children:[Object(r.jsx)(Ce,{amount:t.amount,action:a}),Object(r.jsx)(Ee,{operator:t.offer.operator.name}),Object(r.jsxs)("div",{className:"shoppingCartName",children:[Object(r.jsx)("div",{children:t.offer.name}),Object(r.jsx)(Ne,{currentSub:t.current,offerSub:t.offer,currentSubOffer:t.current.offer,shoppingCart:!0})]}),Object(r.jsx)("span",{}),Object(r.jsxs)("div",{className:"cheaperPrice",children:[t.amount>1?Object(r.jsxs)("div",{className:"flexRow",children:[Object(r.jsxs)("div",{children:[(t.offer.offer*t.amount).toFixed(2),Object(r.jsx)("span",{className:"small",children:"\u20ac/kk"})]}),Object(r.jsx)("div",{className:"slash",children:"/"}),Object(r.jsx)("div",{children:Object(r.jsxs)("span",{className:"small",children:["(",t.offer.offer," \u20ac/kk)"]})})]}):Object(r.jsxs)("div",{children:[t.offer.offer," ",Object(r.jsx)("span",{className:"small",children:" \u20ac/kk"})]}),i()>0?Object(r.jsxs)("div",{className:"dropdownCheaperPrice",children:["s\xe4\xe4st\xe4t ",i()," \u20ac /vuosi"]}):null]}),Object(r.jsx)("span",{}),t.offer.oneTimeDiscount?Object(r.jsxs)(r.Fragment,{children:[" ",Object(r.jsxs)("div",{children:[t.offer.oneTimeDiscount*t.amount,Object(r.jsx)("span",{className:"small",children:" \u20ac lahjakortti"})]})," "]}):null,Object(r.jsx)(I.a,{icon:"trash",onClick:function(){return a("DELETE")}})]})})},ht=function(e){var t=e.shoppingCart,n=e.setShoppingCart,a=Object(i.useState)(!1),s=Object(u.a)(a,2),c=s[0],o=s[1],j=function(e,a){var r=t.findIndex((function(e){return a===e.id})),i=t[r],s=t.filter((function(e){return a!==e.id}));switch(e){case"ADD":i.amount++,n([].concat(Object(l.a)(s),[i]));break;case"SUBTRACT":if(t[r].amount<=1)return null;i.amount--,n([].concat(Object(l.a)(s),[i]));break;case"DELETE":n(Object(l.a)(s));break;case"DELETE_ALL":n([]),o(!1);break;default:console.log("invalid action in editItemAmount")}};return Object(r.jsxs)(ke.a,{className:"shoppingCartModal",onClose:function(){return o(!1)},onOpen:function(){return o(!0)},open:c,trigger:Object(r.jsxs)("div",{className:"shoppingCartButtonContainer",children:[Object(r.jsx)(I.a,{className:"shoppingCartButton",color:"green",icon:"shop"}),t.length>0?Object(r.jsx)("span",{children:t.length}):null]}),children:[Object(r.jsx)(ke.a.Header,{children:Object(r.jsxs)("div",{className:"flexRow",children:[Object(r.jsx)(N.a,{as:"h2",children:"Ostoskori"}),Object(r.jsx)(I.a,{className:"closeButton",onClick:function(){return o(!1)},icon:"x"})]})}),Object(r.jsxs)(ke.a.Content,{children:[t.sort((function(e,t){return e.offer.name<t.offer.name?1:e.offer.name>t.offer.name?-1:0})).map((function(e){return Object(r.jsx)(bt,{item:e,editItemAmount:j},e.id)})),Object(r.jsx)(dt,{shoppingCart:t})]}),Object(r.jsx)(ke.a.Actions,{children:Object(r.jsx)(I.a,{content:"Tyhjenn\xe4",labelPosition:"right",icon:"trash",onClick:function(){return j("DELETE_ALL")}})})]})},Ot=function(){var e=Object(i.useState)(null),t=Object(u.a)(e,2),n=t[0],a=t[1],s=Object(i.useState)("Puheliittym\xe4t"),c=Object(u.a)(s,2),o=c[0],b=c[1],h=Object(i.useState)([]),O=Object(u.a)(h,2),m=O[0],f=O[1],p=Object(j.useApolloClient)();Object(i.useEffect)((function(){var e=U("g-app-user-token");e&&a(e)}),[]);return n?Object(r.jsxs)(r.Fragment,{children:[n&&Object(r.jsx)(G,{activePage:o,setActivePage:b,logout:function(){a(null),R("g-app-user-token","",0),p.resetStore()}}),"admin"!==o&&Object(r.jsx)(ht,{shoppingCart:m,setShoppingCart:f}),Object(r.jsxs)(d.c,{children:[Object(r.jsx)(d.a,{path:"/puheliittymat",children:Object(r.jsx)(Ye,{handleShoppingCart:function(e,t){if("ADD"===e){if(m.find((function(e){return t.id===e.id})))return null;f([].concat(Object(l.a)(m),[t]))}else"DELETE"===e?f(Object(l.a)(m.filter((function(e){return e.id!==t.id})))):console.log("Wrong parameter to handleShoppingCart")}})}),Object(r.jsx)(d.a,{path:"/admin",children:Object(r.jsx)(jt,{})}),Object(r.jsx)(d.a,{path:"/"})]})]}):Object(r.jsx)(r.Fragment,{children:Object(r.jsx)(P,{setToken:a})})},mt={loginType:o.LoginType.Redirect,tokenRefreshUri:window.location.origin+"/auth.html"},ft=new o.MsalAuthProvider({auth:{clientId:"75e4a3b2-8901-43fa-8ec9-0ba3fbeeb352",authority:"https://login.microsoftonline.com/common",redirectUri:"http://localhost:3000/"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}},{scopes:["user.read"]},mt),pt=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,299)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,i=t.getLCP,s=t.getTTFB;n(e),a(e),r(e),i(e),s(e)}))},xt=n(227),At=Object(xt.a)((function(e,t){var n=t.headers,r="";return r=U("g-app-user-token"),{headers:Object(a.a)(Object(a.a)({},n),{},{authorization:r?"bearer ".concat(r):null})}})),wt=new j.HttpLink({uri:"/graphql"}),gt=new j.ApolloClient({cache:new j.InMemoryCache,link:At.concat(wt),credentials:"include"});c.a.render(Object(r.jsx)(o.AzureAD,{provider:ft,forceLogin:!0,children:Object(r.jsx)(j.ApolloProvider,{client:gt,children:Object(r.jsx)(W.a,{children:Object(r.jsx)(Ot,{})})})}),document.getElementById("root")),pt()}},[[267,1,2]]]);
  //# sourceMappingURL=main.15e1544f.chunk.js.map