PageSourceSearch

https://www.ditp.go.th/_next/static/chunks/pages/category/[category]-fd9f6a0b1b860894.js

js ditp.go.th collected 2026-10-02 04:02:56 UTC 9,777 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5694],{8183:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/category/[category]",function(){return a(63197)}])},3632:function(e,t,a){"use strict";a.d(t,{Z:function(){return i}});var r=a(85893),n=a(41664),s=a.n(n),o=a(11163);function i(e){let{paths:t}=e,a=(0,o.useRouter)();return(0,r.jsx)("nav",{className:"text-gray-500 text-sm overflow-x-auto whitespace-nowrap custom-scroll",children:(0,r.jsx)("div",{className:"max-w-screen-xl mx-auto px-4",children:(0,r.jsxs)("div",{className:"flex space-x-2 items-center",children:[(0,r.jsx)("img",{src:"/icons/home.png",alt:"Profile",className:"w-4 h-4"}),t.filter(e=>e.label).map((e,n)=>(0,r.jsxs)("div",{className:"flex items-center space-x-2 mt-2",children:[n>0&&(0,r.jsx)("span",{className:"text-gray-400",children:"/"}),n===t.length-1?(0,r.jsx)("span",{className:"text-black font-semibold",children:e.label}):e.link?(0,r.jsx)(s(),{href:e.link,legacyBehavior:!0,locale:a.locale,children:(0,r.jsx)("a",{className:"text-gray-400 hover:text-gray-600",children:e.label})}):(0,r.jsx)("div",{className:"text-gray-400 line-clamp-1",children:e.label})]},n))]})})})}},52467:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var r=a(85893),n=a(69740);function s(e){let{currentPage:t,totalPages:a,itemsPerPage:s,totalItems:o,setCurrentPage:i,setItemsPerPage:l,handlePageClick:c,disableScroll:d=!1}=e,p=()=>{d||(0,n.UK)()||window.scrollTo({top:0,behavior:"auto"})},m=e=>{p(),c(e)};return(0,r.jsx)("div",{className:"max-w-screen-xl mx-auto mt-8",children:(0,r.jsxs)("div",{className:"flex justify-center md:justify-between items-center",children:[(0,r.jsxs)("div",{className:"hidden md:flex md:flex-wrap lg:flex-row items-center",children:[(0,r.jsx)("label",{children:"Items per page"}),(0,r.jsx)("select",{value:s,onChange:e=>{l(Number(e.target.value)),i(1),p()},className:"ml-2 border rounded-md px-2 py-1",children:[10,20,50,100].map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsxs)("div",{className:"md:mt-2 lg:ml-2",children:["Showing ",(t-1)*s+1," -"," ",Math.min(t*s,o)," of ",o," ","Posts"]})]}),(0,r.jsxs)("div",{className:"flex md:space-x-2",children:[(0,r.jsxs)("button",{onClick:()=>m(t-1),disabled:1===t,className:"px-3 py-1 border rounded-2xl disabled:opacity-50 flex items-center gap-2",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-6 h-6",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})}),(0,r.jsx)("div",{className:"hidden md:block",children:"Previous"})]}),(0,r.jsx)("div",{className:"flex items-center space-x-1",children:(()=>{let e=[];for(let r=0;r<Math.min(7,a);r++){let n;n=a<=7?r+1:t<=4?r<5?r+1:5===r?"...":a:t>a-4?0===r?1:1===r?"...":a-(6-r):0===r?1:1===r?"...":r<5?t-(3-r):5===r?"...":a,e.push(n)}return e})().map((e,a)=>(0,r.jsx)("button",{onClick:()=>"number"==typeof e?m(e):null,disabled:"..."===e,className:"px-3 py-1 rounded-lg w-8 h-8 flex items-center justify-center  ".concat(t===e?"bg-[#0E143B] text-white border-[#0E143B]":"text-[#00000080]"),children:e},a))}),(0,r.jsxs)("button",{onClick:()=>m(t+1),disabled:t===a,className:"px-3 py-1 border rounded-2xl disabled:opacity-50 flex items-center gap-2",children:[(0,r.jsx)("div",{className:"hidden md:block",children:"Next"}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-6 h-6",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"})})]})]})]})})}},63197:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return u},default:function(){return h}});var r=a(85893),n=a(41664),s=a.n(n),o=a(3632),i=a(76809),l=a(67294),c=a(52467),d=a(11163),p=a(66308),m=a(63805),u=!0;function h(e){var t;let{category:a}=(0,d.useRouter)().query,{locale:n}=(0,d.useRouter)(),[u,h]=(0,l.useState)(e.currentPage),[x,f]=(0,l.useState)(e.itemsPerPage),[_,y]=(0,l.useState)(e.category||[]),[g,v]=(0,l.useState)(0),[b,w]=(0,l.useState)(0),[j,N]=(0,l.useState)(!0);(0,l.useEffect)(()=>{(async()=>{N(!0);try{let e=(u-1)*x,t=[{method:i.hi.getAboutditpquery,type:"about_ditp_2s"},{method:i.hi.getditphonestquery,type:"ditp_honest_transparent_no_corruptions"},{method:i.hi.getprocurementquery,type:"procurement_news"},{method:i.hi.getinternationalquery,type:"international_trade_promotion_funds"},{method:i.hi.getservicequery,type:"service_standard_posts"},{method:i.hi.getgovernmentquery,type:"government_information_center_posts"},{method:i.hi.getapplyquery,type:"apply_for_work_posts"},{method:i.hi.getprivacyquery,type:"privacy_policy_posts"},{method:i.hi.getsitequery,type:"sitemap"}
1],r=new URLSearchParams;r.append("filters[category_about_ditp_2][name][$in]",a),r.append("locale",n);let s=new URLSearchParams;s.append("filters[category_international_trade_promotion_fund][name][$in]",a),s.append("locale",n);let o=new URLSearchParams;o.append("filters[category_procurement_new][name][$in]",a),o.append("locale",n);let l=new URLSearchParams;l.append("filters[category_ditp_honest][name][$in]",a),l.append("locale",n);let c=new URLSearchParams;c.append("filters[category_service_standard][name][$in]",a),c.append("locale",n);let d=new URLSearchParams;d.append("filters[category_government_information_center][name][$in]",a),d.append("locale",n);let p=new URLSearchParams;p.append("filters[category_privacy_policy][name][$in]",a),p.append("locale",n);let m=new URLSearchParams;m.append("filters[category_apply_for_work][name][$in]",a),m.append("locale",n);let h=new URLSearchParams;h.append("filters[category_site_map][name][$in]",a),h.append("locale",n);let f={about_ditp_2s:r,ditp_honest_transparent_no_corruptions:l,procurement_news:o,international_trade_promotion_funds:s,service_standard_posts:c,government_information_center_posts:d,apply_for_work_posts:m,privacy_policy_posts:p,sitemap:h},_=await Promise.all(t.map(e=>{var t;let a=(null===(t=f[e.type])||void 0===t?void 0:t.toString())||"";return e.method(a,1,1).then(t=>{var a,r,n;return{total:(null==t?void 0:null===(n=t.data)||void 0===n?void 0:null===(r=n.meta)||void 0===r?void 0:null===(a=r.pagination)||void 0===a?void 0:a.total)||0,type:e.type}}).catch(()=>({total:0,type:e.type}))})),g=_.reduce((e,t)=>e+t.total,0);v(g),w(Math.ceil(g/x));let b=_.reduce((e,t)=>{let{type:a,total:r}=t;return e[a]=r,e},{}),j=[],k=x,P=e;for(let e of t){let t=b[e.type]||0;if(0===t||P>=t){P-=t;continue}let a=t-P,r=Math.min(a,k);if(r>0){let t=Math.floor(P/x)+1,a=P%x;if(j.push({method:e.method,type:e.type,page:t,limit:a+r,offset:a,itemsToTake:r}),(k-=r)<=0)break}P=0}let S=(await Promise.all(j.map(e=>{var t;let a=(null===(t=f[e.type])||void 0===t?void 0:t.toString())||"";return e.method(a,e.page,e.limit).then(t=>{var a;return((null==t?void 0:null===(a=t.data)||void 0===a?void 0:a.data)||[]).slice(e.offset,e.offset+e.itemsToTake).map(t=>({...t,type:e.type}))}).catch(()=>[])}))).flat();y(S),N(!1)}catch(e){console.error("Error fetching data:",e),N(!1)}})()},[u,x]);let k=[{label:e.message.HomePage.home,link:"/"},{label:a}],P=(e,t,a)=>{switch(e){case"about_ditp_2s":return"/post/about/about-ditp-2/".concat(t);case"ditp_honest_transparent_no_corruptions":return"/post/ditp-honest/".concat(t);case"procurement_news":return"/post/inthecountry/".concat(t);case"international_trade_promotion_funds":return"/post/international-trade-promotion-fund/".concat(t);case"service_standard_posts":return"/post/service-standard/".concat(t);case"government_information_center_posts":return"/post/government/".concat(t);case"privacy_policy_posts":return"/privacy-policy/".concat(t);case"apply_for_work_posts":return"/apply-for-work/apply-for-work-post/".concat(t);case"sitemap":return"/data-governance-policy/".concat(t);default:return""}};return(0,r.jsxs)("div",{className:"pt-16 pb-16",style:{backgroundColor:"#ffffff",backgroundImage:"url('/images/bg.jpg')",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"repeat"},children:[(0,r.jsx)(p.Z,{title:"".concat(a," - กรมส่งเสริมการค้าระหว่างประเทศ"),description:"บทความในหมวดหมู่ ".concat(a),breadcrumbs:k}),(0,r.jsx)("div",{className:"sticky top-[60px] bg-white",children:(0,r.jsx)(o.Z,{paths:k})}),(0,r.jsx)("div",{className:"max-w-screen-lg mx-auto px-4",children:(0,r.jsxs)("div",{className:"mt-8",children:[(0,r.jsx)("div",{className:"mt-12 mb-8 text-2xl md:text-[40px] font-semibold text-gradient inline",children:a}),(0,r.jsx)("div",{className:"grid grid-cols-1",children:j?Array.from({length:x}).map((e,t)=>(0,r.jsx)("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center mt-4 border-b-2 pb-6 animate-pulse",children:(0,r.jsx)("div",{className:"md:w-[900px]",children:(0,r.jsx)("div",{className:"h-5 bg-gray-200 rounded w-full mb-2"})})},t)):null===(t=(0,m.IU)(_))||void 0===t?void 0:t.map((e,t)=>(0,r.jsx)(s(),{href:P(e.type,e.documentId),children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center mt-4 border-b-2 pb-6",children:[(0,r.jsx)("div",{className:"md:w-[900px]",children:(0,r.jsx)("div",{children:e.title})}),(0,r.jsx)("button",{type:"button",className:"w-[190px] h-[42px] md:h-[53px] border border-[#10143C] rounded-full mt-4 md:mt-0",children:(0,r.jsx)("div",{className:"text-center",children:"ดูรายละเอียด"})})]})},t))}),g>10&&(0,r.jsx)(c.Z,{currentPage:u,totalPages:b,itemsPerPage:x,totalItems:g,setCurrentPage:h,setItemsPerPage:f,handlePageClick:e=>{h(e)}})]})})]})}}},function(e){e.O(0,[2275,6308,1289,2888,9774,179],function(){return e(e.s=8183)}),_N_E=e.O()}]);

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.