1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3518],{47201:function(e,t,n){"use strict";n.r(t);var r=n(85893),a=n(809),o=n.n(a),i=n(30266),l=n(92809),s=n(99682),u=n(67294),c=n(39828),d=n(75808),p=n(11163),m=n(93447),f=n(41664),b=n(10999);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.default=function(){var e=(0,u.useState)(""),t=e[0],n=e[1],a=(0,u.useState)(""),x=a[0],g=a[1],v=(0,u.useState)(0),y=v[0],j=v[1],w=(0,u.useState)(""),N=w[0],E=w[1],T=(0,u.useState)([]),k=T[0],C=T[1],O=(0,p.useRouter)(),A=function(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},I=function(e){var t={id:(0,b.x0)(),contentsType:e,title:"",description:"TEXT"===e||"IMAGETEXT"===e?"":null,images:"IMAGE"===e||"IMAGETEXT"===e?"":null,imagesTitle:"IMAGE"===e||"IMAGETEXT"===e?"":null,pictures:"IMAGE"===e||"IMAGETEXT"===e?"":null,picturesTitle:"IMAGE"===e||"IMAGETEXT"===e?"":null,order:k.length+1};C((function(e){return[].concat((0,s.Z)(e),[t])}))},R=function(e,t,n){C((function(r){return r.map((function(r){return r.id===e?h(h({},r),{},(0,l.Z)({},t,n)):r}))}))},S=function(e,t){var n=(0,s.Z)(k),r="up"===t?e-1:e+1;if(r>=0&&r<n.length){var a=[n[r],n[e]];n[e]=a[0],n[r]=a[1],n.forEach((function(e,t){e.order=t+1})),C(n)}},M=function(){var e=(0,i.Z)(o().mark((function e(n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),r=A(t),e.prev=2,e.next=5,(0,c.pl)((0,c.JU)(d.db,"stages",r),{title:t,slug:r,description:x,day:y,image:N,Content:k,createDate:(new Date).toISOString(),updatedAt:(new Date).toISOString()});case 5:O.push("/admin/stages"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),console.error("Error adding document: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}(),G=function(e,t){return(0,r.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg border mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsxs)("h4",{className:"font-semibold",children:["\u0130\xe7erik #",t+1," - ",e.contentsType]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("button",{type:"button",onClick:function(){return S(t,"up")},disabled:0===t,className:"mr-2",children:"\u2191"}),(0,r.jsx)("button",{type:"button",onClick:function(){return S(t,"down")},disabled:t===k.length-1,className:"mr-2",children:"\u2193"}),(0,r.jsx)("button",{type:"button",onClick:function(){return t=e.id,void C((function(e){return e.filter((function(e){return e.id!==t}))}));var t},className:"text-red-500",children:"\u2715"})]})]}),"TEXT"===e.contentsType&&(0,r.jsx)("textarea",{value:e.description,onChange:function(t){return R(e.id,"description",t.target.value)},className:"w-full p-2 border rounded"}),"IMAGE"===e.contentsType&&(0,r.jsxs)("div",{children:[(0,r.jsx)("input",{type:"text",value:e.images,onChange:function(t){return R(e.id,"images",t.target.value)},placeholder:"Resim URL",className:"w-full p-2 border rounded mb-2"}),(0,r.jsx)("input",{type:"text",value:e.imagesTitle,onChange:function(t){return R(e.id,"imagesTitle",t.target.value)},placeholder:"Resim Ba\u015fl\u0131\u011f\u0131",className:"w-full p-2 border rounded mb-2"}),(0,r.jsx)("input",{type:"text",value:e.pictures,onChange:function(t){return R(e.id,"pictures",t.target.value)},placeholder:"\u0130kinci Resim URL",className:"w-full p-2 border rounded mb-2"}),(0,r.jsx)("input",{type:"text",value:e.picturesTitle,onChange:function(t){return R(e.id,"picturesTitle",t.target.value)},placeholder:"\u0130kinci Resim Ba\u015fl\u0131\u011f\u0131",className:"w-full p-2 border rounded"})]}),"IMAGETEXT"===e.contentsType&&(0,r.jsxs)("div",{children:[(0,r.jsx)("textarea",{value:e.description,onChange:function(t){return R(e.id,"description",t.target.value)},className:"w-full p-2 border rounded mb-2"}),(0,r.jsx)("input",{type:"text",value:e.images,onChange:function(t){return R(e.id,"images",t.target.value)},placeholder:"Resim URL",className:"w-full p-2 border rounded mb-2"}),(0,r.jsx)("input",{type:"text",value:e.imagesTitle,onChange:function(t){return R(e.id,"imagesTitle",t.target.value)},placeholder:"Resim Ba\u015fl\u0131\u011f\u0131",className:"w-full p-2 border rounded mb-2"}),(0,r.jsx)("input",{type:"text",value:e.pictures,onChange:function(t){return R(e.id,"pictures",t.target.value)},placeholder:"\u0130kinci Resim URL",className:"w-full p-2 border rounded mb-2"}),(0,r.jsx)("input",{type:"text",value:e.picturesTitle,onChange:function(t){return R(e.id,"picturesTitle",t.target.value)},placeholder:"\u0130kinci Resim Ba\u015fl\u0131\u011f\u0131",className:"w-full p-2 border rounded"})]})]},e.id)};return(0,r.jsx)(m.Z,{children:(0,r.jsx)("div",{className:"container mx-auto px-4 sm:px-8",children:(0,r.jsxs)("div",{className:"py-8",children:[(0,r.jsx)("div",{children:(0,r.jsx)("h2",{className:"text-2xl font-semibold leading-tight",children:"Yeni Yaz\u0131 Ekle"})}),(0,r.jsx)("div",{className:"my-2 flex sm:flex-row flex-col",children:(0,r.jsx)(f.default,{href:"/admin/stages",children:(0,r.jsx)("a",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 roun
1ded",children:"Geri"})})}),(0,r.jsx)("div",{className:"-mx-4 sm:-mx-8 px-4 sm:px-8 py-4 overflow-x-auto",children:(0,r.jsx)("div",{className:"inline-block min-w-full shadow rounded-lg overflow-hidden",children:(0,r.jsxs)("form",{onSubmit:M,className:"p-4",children:[(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:"Ba\u015fl\u0131k"}),(0,r.jsx)("input",{type:"text",value:t,onChange:function(e){return n(e.target.value)},className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:"A\xe7\u0131klama"}),(0,r.jsx)("textarea",{value:x,onChange:function(e){return g(e.target.value)},className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:"G\xfcn"}),(0,r.jsx)("input",{type:"number",value:y,onChange:function(e){return j(parseInt(e.target.value))},className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:"Resim URL"}),(0,r.jsx)("input",{type:"text",value:N,onChange:function(e){return E(e.target.value)},className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"\u0130\xe7erik"}),k.map((function(e,t){return G(e,t)})),(0,r.jsx)("button",{type:"button",onClick:function(){return I("TEXT")},className:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded mr-2",children:"Metin Ekle"}),(0,r.jsx)("button",{type:"button",onClick:function(){return I("IMAGE")},className:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded mr-2",children:"Resim Ekle"}),(0,r.jsx)("button",{type:"button",onClick:function(){return I("IMAGETEXT")},className:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",children:"Resim ve Metin Ekle"})]}),(0,r.jsx)("button",{type:"submit",className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Ekle"})]})})})]})})})}},57250:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/stages/add",function(){return n(47201)}])},10999:function(e,t,n){"use strict";n.d(t,{x0:function(){return r}});let r=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t}},99682:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d(t,{Z:function(){return a}})}},function(e){e.O(0,[2016,6420,9105,3336,3447,9774,2888,179],(function(){return t=57250,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.