https://www.sethness-roquette.com/component---src-pages-admin-news-index-tsx-f00bdd5481d08e996fe1.js
1"use strict";(self.webpackChunksethness_roquette=self.webpackChunksethness_roquette||[]).push([[8923],{59062:function(e,t,n){n.d(t,{Z:function(){return S}});var a=n(63366),r=n(87462),i=n(67294),s=n(86010),l=n(94780),o=n(70917),c=n(98216),m=n(16122),u=n(29602),d=n(1588),g=n(34867);function f(e){return(0,g.Z)("MuiCircularProgress",e)}(0,d.Z)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var v=n(85893);const w=["className","color","disableShrink","size","style","thickness","value","variant"];let p,h,b,E,N=e=>e;const k=44,P=(0,o.F4)(p||(p=N` 2 0% { 3 transform: rotate(0deg); 4 } 5 6 100% { 7 transform: rotate(360deg); 8 } 9`)),x=(0,o.F4)(h||(h=N` 10 0% { 11 stroke-dasharray: 1px, 200px; 12 stroke-dashoffset: 0; 13 } 14 15 50% { 16 stroke-dasharray: 100px, 200px; 17 stroke-dashoffset: -15px; 18 } 19 20 100% { 21 stroke-dasharray: 100px, 200px; 22 stroke-dashoffset: -125px; 23 } 24`)),y=(0,u.ZP)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${(0,c.Z)(n.color)}`]]}})((({ownerState:e,theme:t})=>(0,r.Z)({display:"inline-block"},"determinate"===e.variant&&{transition:t.transitions.create("transform")},"inherit"!==e.color&&{color:(t.vars||t).palette[e.color].main})),(({ownerState:e})=>"indeterminate"===e.variant&&(0,o.iv)(b||(b=N` 25 animation: ${0} 1.4s linear infinite; 26 `),P))),L=(0,u.ZP)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),M=(0,u.ZP)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${(0,c.Z)(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((({ownerState:e,theme:t})=>(0,r.Z)({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})),(({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&(0,o.iv)(E||(E=N` 27 animation: ${0} 1.4s ease-in-out infinite; 28 `),x)));var S=i.forwardRef((function(e,t){const n=(0,m.Z)({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:u=!1,size:d=40,style:g,thickness:p=3.6,value:h=0,variant:b="indeterminate"}=n,E=(0,a.Z)(n,w),N=(0,r.Z)({},n,{color:o,disableShrink:u,size:d,thickness:p,value:h,variant:b}),P=(e=>{const{classes:t,variant:n,color:a,disableShrink:r}=e,i={root:["root",n,`color${(0,c.Z)(a)}`],svg:["svg"],circle:["circle",`circle${(0,c.Z)(n)}`,r&&"circleDisableShrink"]};return(0,l.Z)(i,f,t)})(N),x={},S={},I={};if("determinate"===b){const e=2*Math.PI*((k-p)/2);x.strokeDasharray=e.toFixed(3),I["aria-valuenow"]=Math.round(h),x.strokeDashoffset=`${((100-h)/100*e).toFixed(3)}px`,S.transform="rotate(-90deg)"}return(0,v.jsx)(y,(0,r.Z)({className:(0,s.Z)(P.root,i),style:(0,r.Z)({width:d,height:d},S,g),ownerState:N,ref:t,role:"progressbar"},I,E,{children:(0,v.jsx)(L,{className:P.svg,ownerState:N,viewBox:"22 22 44 44",children:(0,v.jsx)(M,{className:P.circle,style:x,ownerState:N,cx:k,cy:k,r:(k-p)/2,fill:"none",strokeWidth:p})})}))}))},98216:function(e,t,n){var a=n(28320);t.Z=a.Z},95052:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(67294);var r=e=>{let{title:t,children:n}=e;return a.createElement("div",{className:"pageLayout-module--layout--bbae4"},a.createElement("div",{className:"pageLayout-module--title--159c6"},a.createElement("h1",null,t)),n)}},58558:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(67294),r=n(20574);var i=()=>(0,r.useStaticQuery)("8668112");var s=e=>{let{title:t,description:n,privatePage:r}=e;const s=i();return r?a.createElement(a.Fragment,null,a.createElement("title",null,t||s.site.siteMetadata.title),a.createElement("meta",{name:"robots",content:"noindex, nofollow"})):a.createElement(a.Fragment,null,a.createElement("title",null,t||s.site.siteMetadata.title),a.createElement("meta",{name:"author",content:s.site.siteMetadata.author}),n&&a.createElement("meta",{name:"description",content:n}),a.createElement("meta",{name:"keywords",content:"sethness-roquette, caramels de spécialité, specialty caramels, colorant caramel, caramel color, caramel de spécialité, caramel au beurre salé, salted butter caramel, caramel sauce, caramel flakes, éclats de caramel, burnt sugar, caramel ingrédient, caramel industriel"}))}},55869:function(e,t,n){n.r(t),n.d(t,{Head:function(){return T},default:function(){return D}});var a=n(67294),r=n(46657),i=n(93422),s=n(59417),l=n(67814),o=n(27782),c=n(58558),m=n(68093),u=n(77183),d=n(95052),g=n(11817),f=n(59062),v=n(20574),w=n(66746),p=n(71899),h=n(47901),b=n(95435);const E="...";var N=n(20393),k=n(89938);const P=e=>{const{className:t,...n}=e;return a.createElement(h.G,{as:"span",width:"1em",height:"1em",className:(0,w.A)(p.M.Icon,t),...n},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M15.41 7.41L14 6L8 12L14 18L15.41 16.59L10.83 12L15.41 7.41Z",fill:"currentColor"})))},x=e=>{const{className:t,...n}=e;return a.createElement(h.G,{as:"span",width:"1em",height:"1em",className:(0,w.A)(p.M.Icon,t),...n},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9.99984 6L8.58984 7.41L13.1698 12L8.58984 16.59L9.99984 18L15.9998 12L9.99984 6Z",fill:"currentColor"})))};var y=n(41593),L=n(21266);const M=({type:e,page:t,currentPage:n,currentPageLabel:s=L.b9.PaginationItem.currentPageLabel,isDisabled:l,onClick:o,ariaLabel:c,...m})=>{const u=(0,k.y)("pagination"),d=(0,w.A)(p.M.PaginationItem,(0,N.wq)(p.M.PaginationItem,"link"),(0,N.T2)(p.M.PaginationItem,"disabled",l)),g=(0,w.A)(p.M.PaginationItem,(0,N.wq)(p.M.PaginationItem,"link"),(0,N.T2)(p.M.PaginationItem,"disabled",l));switch(e){case"page":return a.createElement(h.G,{as:"li"},t===n?a.createElement(i.z,{"aria-current":"page",size:"small",variation:"link",className:(0,w.A)(p.M.PaginationItem,(0,N.wq)(p.M.PaginationItem,"current")),testId:"current",...m},a.createElement(y.T,null,s,":"),t):a.createElement(i.z,{className:p.M.PaginationItem,size:"small",variation:"link",onClick:()=>{o?.()},ariaLabel:c,...m},t));case"next":return a.createElement(h.G,{as:"li"},a.createElement(i.z,{className:d,size:"small",variation:"link",isDisabled:l,onClick:()=>{o?.()},ariaLabel:c,...m},u?.next??a.createElement(x,null)));case"previous":return a.createElement(h.G,{as:"li"},a.createElement(i.z,{className:g,size:"small",variation:"link",isDisabled:l,onClick:()=>{o?.()},ariaLabel:c,...m},u?.previous??a.createElement(P,null)));case"ellipsis":return a.createElement(h.G,{as:"li"},a.createElement(r.k,{as:"span",className:(0,N.wq)(p.M.PaginationItem,"ellipsis"),testId:"ellipsis",...m},"â¦"))}return a.createElement(h.G,{as:"li"})};M.displayName="PaginationItem";const S=({currentPage:e,totalPages:t,hasMorePages:n,siblingCount:r,currentPageLabel:i=L.b9.PaginationItem.currentPageLabel,pageLabel:s=L.b9.PaginationItem.pageLabel,previousLabel:l=L.b9.PaginationItem.previousLabel,nextLabel:o=L.b9.PaginationItem.nextLabel,onNext:c,onPrevious:m,onChange:u})=>{const d=a.createElement(M,{type:"previous",key:"previous",currentPage:e,onClick:m,isDisabled:e<=1,ariaLabel:l}),g=a.createElement(M,{type:"next",key:"next",currentPage:e,onClick:c,isDisabled:e>=t&&!n,ariaLabel:o}),f=((e,t,n=1)=>a.useMemo((()=>
28{const a=Math.max(e,1),r=Math.max(n,1),i=Math.max(a,t),s=i;if(i<5+2*r)return(0,b.OJ)(1,i);const l=Math.max(a-r,1),o=Math.min(a+r,s),c=l>2,m=o<s-1;if(c&&!m){const e=3+2*r,t=(0,b.OJ)(s-e+1,s);return[1,E,...t]}if(!c&&m){const e=3+2*r;return[...(0,b.OJ)(1,e),E,s]}const u=(0,b.OJ)(l,o);return[1,E,...u,E,s]}),[e,t,n]))(e,t,r);return[d,...a.useMemo((()=>f.map(((t,n)=>t===E?a.createElement(M,{type:"ellipsis",key:1===n?"start-ellipsis":"end-ellipsis"}):a.createElement(M,{key:t,type:"page",page:t,currentPage:e,currentPageLabel:i,onClick:()=>u?.(t,e),ariaLabel:`${s} ${t}`})))),[f,e,i,s,u]),g]};const I=(0,n(53139).R)((({className:e,currentPage:t=1,totalPages:n,hasMorePages:i=!1,siblingCount:s,currentPageLabel:l,pageLabel:o,previousLabel:c,nextLabel:m,onNext:u,onPrevious:d,onChange:g,...f},v)=>{const b=S({currentPage:t,totalPages:n,hasMorePages:i,siblingCount:s,currentPageLabel:l,pageLabel:o,previousLabel:c,nextLabel:m,onNext:u,onPrevious:d,onChange:g});return a.createElement(h.G,{as:"nav",className:(0,w.A)(p.M.Pagination,e),ref:v,...f},a.createElement(r.k,{as:"ol",justifyContent:"center",alignItems:"center",gap:"inherit"},b))}));I.displayName="Pagination";var C=n(23676),Z=n(16519);var z=()=>{const{t:e,i18n:t}=(0,o.useTranslation)(),{0:n,1:r}=(0,a.useState)(1),{0:c,1:u}=(0,a.useState)(""),d=(0,v.useStaticQuery)("1113866230"),{0:w,1:p}=(0,a.useMemo)((()=>[d.news.nodes.map((e=>e.childMdx.frontmatter)),d.images.nodes]),[d]);return a.createElement("div",{className:Z.zi},w.sort(((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime())).slice(5*(n-1),5*n).map(((n,r)=>{var d;return a.createElement("div",{key:r,className:Z.r},a.createElement("span",{className:Z.hT},new Intl.DateTimeFormat(t.language,{dateStyle:"medium"}).format(new Date(n.date))),a.createElement("div",{className:Z.t$},a.createElement("div",{className:Z.BH},(0,C.wn)(e,n,(0,C.mI)(p,n,n.content.find((e=>!!e.image.src))))),a.createElement("div",{className:Z.Nw},a.createElement(o.Link,{to:"/news/"+n.slug+"?"+m.Tx+"=true"},a.createElement(i.z,{size:"small",border:"none",colorTheme:"info",disabled:!!c},a.createElement(l.G,{icon:s.Mdf}),"Â Â ",e("admin.news.preview.button"))),a.createElement(o.Link,{to:"/"+m.vS+"/news/edit/"+n.slug},a.createElement(i.z,{size:"small",border:"none",colorTheme:"warning",disabled:!!c},a.createElement(l.G,{icon:s.Xcf}),"Â Â ",e("admin.news.edit.button"))),a.createElement(i.z,{size:"small",border:"none",colorTheme:"error",disabled:!!c,onClick:()=>(async t=>{if(window.confirm(e("admin.news.delete.confirm"))){u(t.date);try{await g.Z.delete("https://vfjizm8kaj.execute-api.eu-west-1.amazonaws.com/dev/sethnessnews?date="+t.date),alert(e("admin.news.delete.success"))}catch(n){console.error("Error:",n),alert(e("admin.news.delete.error"))}u("")}})(n)},c===n.date?a.createElement(f.Z,{size:16}):a.createElement(l.G,{icon:s.$aW}),"Â Â ",e("admin.news.delete.button")))),a.createElement("div",{className:Z.F2},a.createElement("b",{className:Z.TN},e(n.title)),a.createElement("p",{className:Z.w2},(0,C.I9)(e(null===(d=n.content.find((t=>{let{text:n}=t;return!!e(n)})))||void 0===d?void 0:d.text)))))})),a.createElement(I,{currentPage:n,onChange:e=>r(null!=e?e:1),onNext:()=>r(n+1),onPrevious:()=>r(n-1),totalPages:Math.ceil(w.length/5)}))};var D=(0,u.O)((()=>{const{t:e}=(0,o.useTranslation)();return a.createElement(d.Z,{title:e("admin.news.title")},a.createElement(r.k,{alignItems:"center",margin:"0 auto 3rem",justifyContent:"center"},a.createElement(o.Link,{to:"/"+m.vS+"/news/add"},a.createElement(i.z,{variation:"primary"},a.createElement(l.G,{icon:s.XSk}),"Â ",e("admin.news.add.button")))),a.createElement(z,null))}));const T=e=>{let{data:t}=e;const n=JSON.parse(t.locales.edges[0].node.data);return a.createElement(c.Z,{privatePage:!0,title:"ð "+n.admin.news.title+" | "+n.sethness_roquette})}},77183:function(e,t,n){n.d(t,{O:function(){return i}});var a=n(67294),r=n(14852);const i=(e,t)=>function(e,t={}){const{variation:n="modal"}=t;return function(i){return a.createElement(r._,{variation:n,...t},(t=>a.createElement(e,{...i,...t})))}}(e,{hideSignUp:!0,...t})},23676:function(e,t,n){n.d(t,{I9:function(){return m},Kl:function(){return c},OW:function(){return i},mI:function(){return s},wn:function(){return l}});var a=n(67294),r=n(86662);const i="https://youtu.be",s=(e,t,n)=>{const a=null!=n?n:t.content[0],r=e.find((e=>e.relativePath==="news/"+t.date+"/"+a.image.src));return{src:r?r.childImageSharp.gatsbyImageData.images.fallback.src:a.image.src,alt:a.image.alt}},l=(e,t,n,r)=>{var s;const l=(r,s)=>{const l=r.split(i+"/")[1];if(s){return(n=>{var r;return a.createElement("iframe",{src:n,title:null!==(r=e(t.title))&&void 0!==r?r:"",allowFullScreen:!0,style:{aspectRatio:"16/9",border:0}})})("https://www.youtube.com/embed/"+l)}return(t=>{var r;return a.createElement("img",{src:"https://img.youtube.com/vi/"+t+"/0.jpg",alt:null!==(r=e(n.alt))&&void 0!==r?r:""})})(l)};return n.src.includes(i)?l(n.src,r):a.createElement("img",{src:n.src,alt:null!==(s=e(n.alt))&&void 0!==s?s:""})},o=(e,t)=>{var n;return null!==(n=t.split(r.s).reduce(((e,t)=>null==e?void 0:e[t]),e))&&void 0!==n?n:""},c=(e,t)=>t?{date:t.date,slug:t.slug,title:o(e,t.title),content:t.content.map((t=>({id:t.id,title:o(e,t.title),text:o(e,t.text),image:{src:t.image.src,alt:o(e,t.image.alt),position:t.image.position}})))}:{date:"",slug:"",title:"",content:[{id:0,title:"",text:"",image:{src:"",alt:"",position:"left"}}]},m=e=>e.replace(/<[^>]*>/g,"")},16519:function(e,t,n){n.d(t,{BH:function(){return c},EM:function(){return r},F2:function(){return N},K_:function(){return i},NC:function(){return x},Nw:function(){return a},O7:function(){return k},RN:function(){return b},TN:function(){return M},bA:function(){return h},bH:function(){return m},ch:function(){return o},e5:function(){return u},fL:function(){return E},hT:function(){return l},kQ:function(){return s},nI:function(){return v},oF:function(){return y},qi:function(){return P},r:function(){return g},t$:function(){return d},vh:function(){return p},w2:function(){return L},z$:function(){return f},zi:function(){return w}});var a="adminNews-module--actions--24b5d",r="adminNews-module--addSectionBtn--94d6b",i="adminNews-module--banner--eee07",s="adminNews-module--content--89699",l="adminNews-module--date--7a151",o="adminNews-module--deleteSectionBtn--6fd7e",c="adminNews-module--image--fc8d8",m="adminNews-module--imagePicker--cdb91",u="adminNews-module--imageType--5709d",d="adminNews-module--left--7df96",g="adminNews-module--news--3da96",f="adminNews-module--newsForm--7ad0d",v="adminNews-module--newsFormTabs--af38d",w="adminNews-module--newsList--49e17",p="adminNews-module--newsPreview--07f99",h="adminNews-module--open--99898",b="adminNews-module--preview--c1ff5",E="adminNews-module--previewBtn--ca6f3",N="adminNews-module--right--a5786",k="adminNews-module--row--ec556",P="adminNews-module--section--a7d49",x="adminNews-module--selectBtn--99508",y="adminNews-module--slug--2d818",L="adminNews-module--text--5c272",M="adminNews-module--title--8f837"}}]); 29//# sourceMappingURL=component---src-pages-admin-news-index-tsx-f00bdd5481d08e996fe1.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.