1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[728],{9010:function(e,r,t){Promise.resolve().then(t.bind(t,7376))},7658:function(e,r,t){"use strict";let a,l;var n=this&&this.__createBinding||(Object.create?function(e,r,t,a){void 0===a&&(a=t);var l=Object.getOwnPropertyDescriptor(r,t);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,a,l)}:function(e,r,t,a){void 0===a&&(a=t),e[a]=r[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(r,e,t);return o(r,e),r};Object.defineProperty(r,"__esModule",{value:!0}),r.useTurnstile=r.Turnstile=void 0;let i=s(t(2265)),d="undefined"!=typeof globalThis?globalThis:window,c=void 0!==d.turnstile?"ready":"unloaded",u=new Promise((e,r)=>{l={resolve:e,reject:r},"ready"===c&&e(void 0)});{let e="cf__reactTurnstileOnLoad";a=()=>{if("unloaded"===c){c="loading",d[e]=()=>{l.resolve(),c="ready",delete d[e]};let r=`https://challenges.cloudflare.com/turnstile/v0/api.js?onload=${e}&render=explicit`,t=document.createElement("script");t.src=r,t.async=!0,t.addEventListener("error",()=>{l.reject("Failed to load Turnstile."),delete d[e]}),document.head.appendChild(t)}return u}}function m({id:e,className:r,style:t,sitekey:l,action:n,cData:o,theme:s,language:d,tabIndex:u,responseField:m,responseFieldName:h,size:g,fixedSize:p,retry:x,retryInterval:f,refreshExpired:v,appearance:b,execution:w,userRef:j,onVerify:y,onSuccess:N,onLoad:_,onError:k,onExpire:D,onTimeout:C,onAfterInteractive:E,onBeforeInteractive:I,onUnsupported:L}){let O=(0,i.useRef)(null),F=(0,i.useState)({onVerify:y,onSuccess:N,onLoad:_,onError:k,onExpire:D,onTimeout:C,onAfterInteractive:E,onBeforeInteractive:I,onUnsupported:L})[0],S=null!=j?j:O,P=p?{width:"compact"===g?"130px":"flexible"===g?"100%":"300px",height:"compact"===g?"120px":"65px",...t}:t;return(0,i.useEffect)(()=>{if(!S.current)return;let e=!1,r="";return(async()=>{var t,i,p;let j;if("ready"!==c)try{await a()}catch(e){null===(t=F.onError)||void 0===t||t.call(F,e);return}!e&&S.current&&(p=r=window.turnstile.render(S.current,{sitekey:l,action:n,cData:o,theme:s,language:d,tabindex:u,"response-field":m,"response-field-name":h,size:g,retry:x,"retry-interval":f,"refresh-expired":v,appearance:b,execution:w,callback:(e,r)=>{var t,a;null===(t=F.onVerify)||void 0===t||t.call(F,e,j),null===(a=F.onSuccess)||void 0===a||a.call(F,e,r,j)},"error-callback":e=>{var r;return null===(r=F.onError)||void 0===r?void 0:r.call(F,e,j)},"expired-callback":e=>{var r;return null===(r=F.onExpire)||void 0===r?void 0:r.call(F,e,j)},"timeout-callback":()=>{var e;return null===(e=F.onTimeout)||void 0===e?void 0:e.call(F,j)},"after-interactive-callback":()=>{var e;return null===(e=F.onAfterInteractive)||void 0===e?void 0:e.call(F,j)},"before-interactive-callback":()=>{var e;return null===(e=F.onBeforeInteractive)||void 0===e?void 0:e.call(F,j)},"unsupported-callback":()=>{var e;return null===(e=F.onUnsupported)||void 0===e?void 0:e.call(F,j)}}),j={execute:e=>window.turnstile.execute(p,e),reset:()=>window.turnstile.reset(p),getResponse:()=>window.turnstile.getResponse(p),isExpired:()=>window.turnstile.isExpired(p)},null===(i=F.onLoad)||void 0===i||i.call(F,r,j))})(),()=>{e=!0,r&&window.turnstile.remove(r)}},[l,n,o,s,d,u,m,h,g,x,f,v,b,w]),(0,i.useEffect)(()=>{F.onVerify=y,F.onSuccess=N,F.onLoad=_,F.onError=k,F.onExpire=D,F.onTimeout=C,F.onAfterInteractive=E,F.onBeforeInteractive=I,F.onUnsupported=L},[y,N,_,k,D,C,E,I,L]),i.default.createElement("div",{ref:S,id:e,className:r,style:P})}r.Turnstile=m,r.default=m,r.useTurnstile=function(){let[e,r]=(0,i.useState)(c);return(0,i.useEffect)(()=>{"ready"!==c&&u.then(()=>r(c))},[]),d.turnstile}},7376:function(e,r,t){"use strict";t.d(r,{default:function(){return i}});var a=t(7437),l=t(2265),n=t(7658),o=t.n(n),s=t(3448);function i(e){let{lang:r,dict:t}=e,[n,i]=(0,l.useState)(""),[d,c]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),[h,g]=(0,l.useState)(""),[p,x]=(0,l.useState)({}),[f,v]=(0,l.useState)(null),b=async()=>
1{if(!n.trim()){g(t.result.errorInvalidUrl);return}c(!0),g(""),m(null);try{let e;let r=await fetch("/api/video-download",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:n.trim(),token:f,type:"kwai"})});try{e=await r.json()}catch(e){throw Error(t.result.errorResponseFormat)}if(e=JSON.parse(e.data),e=JSON.parse(e.data),console.log("Parsed JSON data:",e),!r.ok)throw Error(e.error||t.result.errorRequestFailed);if(0!==e.code)throw Error(t.result.errorRequestFailed);m(e)}catch(e){g(e instanceof Error?e.message:t.result.errorUnknown)}finally{c(!1)}},w=async function(e,r){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"video",a="".concat(t,"_").concat(r);x(e=>({...e,[a]:!0}));try{let t=document.createElement("a");t.href=e,t.download=r,t.target="_blank",t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),document.body.removeChild(t),setTimeout(()=>{x(e=>({...e,[a]:!1}))},2e3)}catch(e){x(e=>({...e,[a]:!1})),console.error("Download failed:",e)}};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-8 max-w-4xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:t.kwai.inputLabel}),(0,a.jsx)("input",{type:"url",id:"url-input",placeholder:t.kwai.inputPlaceholder,value:n,onChange:e=>i(e.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-red-500 focus:border-transparent",disabled:d})]}),h&&(0,a.jsx)("div",{className:"mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded",children:h}),(0,a.jsx)(o(),{sitekey:s.Q,onVerify:e=>v(e),theme:"auto"}),(0,a.jsxs)("button",{onClick:b,disabled:d||!f,className:"mt-2 relative w-full overflow-hidden rounded-lg bg-red-600 px-6 py-3 font-semibold text-white transition-all duration-300 hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-70 disabled:hover:bg-red-600",children:[d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"absolute inset-0 animate-pulse bg-gradient-to-r from-red-500 via-red-400 to-red-500 opacity-80"}),(0,a.jsx)("span",{className:"animate-shimmer absolute inset-0 bg-gradient-to-r from-transparent via-white/30 to-transparent"})]}),(0,a.jsx)("span",{className:"relative z-10 flex items-center justify-center gap-3",children:d?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"h-5 w-5 animate-spin rounded-full border-2 border-white/30 border-t-white"}),(0,a.jsx)("span",{children:t.result.processing})]}):(0,a.jsx)("span",{children:t.kwai.downloadButton})})]}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-3",children:t.kwai.supportText}),u&&(0,a.jsxs)("div",{className:"mt-12 space-y-8",children:[u.coverImage&&(0,a.jsx)("div",{className:"bg-gradient-to-br from-purple-50 to-pink-50 rounded-2xl shadow-lg border border-purple-100 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("h3",{className:"text-xl font-bold text-gray-900 mb-4 flex items-center",children:[(0,a.jsx)("span",{className:"mr-3 text-2xl",children:"\uD83D\uDDBCï¸"}),t.result.coverImage||"Cover Image"]}),(0,a.jsx)("div",{className:"relative bg-gray-50 rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-all duration-300 group",children:(0,a.jsxs)("div",{className:"aspect-video relative",children:[(0,a.jsx)("img",{src:u.coverImage,alt:"Cover Image",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",referrerPolicy:"no-referrer"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-20 transition-all duration-300 flex items-center justify-center",children:(0,a.jsx)("span",{className:"opacity-0 group-hover:opacity-100 text-white text-2xl transition-opacity duration-300",children:"\uD83D\uDC41ï¸"})})]})}),(0,a.jsx)("button",{onClick:()=>w(u.coverImage,"rednote_cover_image.jpg","image"),disabled:p["image_rednote_cover_image.jpg"],className:"w-full mt-4 px-6 py-3 bg-gradient-to-r from-purple-500 to-pink-500 text-white rounded-xl font-semibold hover:from-purple-600 hover:to-pink-600 transition-all duration-300 flex items-center justify-center shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed",children:p["image_rednote_cover_image.jpg"]?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),t.result.processing||"Downloading..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mr-2",children:"â¬ï¸"}),t.result.downloadImage||"Download Cover Image"]})})]})}),u.imgList&&u.imgList.length>0&&(0,a.jsx)("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 rounded-2xl shadow-lg border border-blue-100 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("h3",{className:"text-xl font-bold text-gray-900 mb-6 flex items-center",children:[(0,a.jsx)("span",{className:"mr-3 text-2xl",children:"\uD83D\uDDBCï¸"}),t.result.imageGallery||"Image Gallery",(0,a.jsxs)("span",{className:"ml-3 px-3 py-1 bg-blue-100 text-blue-800 text-sm font-medium rounded-full",children:[u.imgList.length," ",1===u.imgList.length?t.result.images||"Image":t.result.images||"Images"]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:u.imgList.map((e,r)=>(0,a.jsxs)("div",{className:"group relative bg-gray-50 rounded-xl overflow-hidden shadow-sm hover:shadow-lg transition-all duration-300",children:[(0,a.jsxs)("div",{className:"aspect-square relative overflow-hidden",children:[(0,a.jsx)("img",{src:e,alt:"".concat(t.result.images||"Image"," ").concat(r+1),className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",referrerPolicy:"no-referrer"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-20 transition-all duration-300 flex items-center justify-center",children:(0,a.jsx)("span",{className:"opacity-0 group-hover:opacity-100 text-white text-2xl transition-opacity duration-300",children:"\uD83D\uDC41ï¸"})})]}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsx)("button",{onClick:()=>w(e,"rednote_image_".concat(r+1,".jpg"),"image"),disabled:p["image_rednote_image_".concat(r+1,".jpg")],className:"w-full px-4 py-2.5 bg-gradient-to-r from-purple-500 to-pink-500 text-white rounded-lg text-sm font-semibold hover:from-purple-600 hover:to-pink-600 transition-all duration-300 flex items-center justify-center shadow-md hover:shadow-lg transform hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed",children:p["image_rednote_image_".concat(r+1,".jpg")]?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-3 w-3 border-b-2 border-white mr-2"}),"Downloading..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mr-2",children:"â¬ï¸"}),t.result.downloadImage||"".concat(t.result.images||"Image"," ").concat(r+1)]})})})]},r))})]})}),u.videoList&&u.videoList.length>0&&(0,a.jsx)("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 rounded-2xl shadow-lg border border-blue-100 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("h3",{className:"text-xl font-bold text-gray-900 mb-6 flex items-center",children:[(0,a.jsx)("span",{className:"mr-3 text-2xl",children:"\uD83C\uDFA5"}),t.result.videoInfo||"Video Downloads",(0,a.jsxs)("span",{className:"ml-3 px-3 py-1 bg-green-100 text-green-800 text-sm font-medium rounded-full",children:[u.videoList.length," ",1===u.videoList.length?"Video":"Videos"]})]}),(0,a.jsx)("div",{className:"space-y-4",children:u.videoList.map((e,r)=>(0,a.jsxs)("div",{className:"bg-white rounded-xl p-4 shadow-sm border border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"text-2xl mr-3",children:"\uD83C\uDFAC"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h4",{className:"font-semibold text-gray-900",children:[t.result.downloadMainVideo||"RedNote Video"," ",u.videoList.length>1?"".concat(r+1):""]}),(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"High Quality MP4 Format"})]})]}),(0,a.jsx)("div",{className:"text-right",children:(0,a.jsx)("div",{className:"text-xs text-gray-400",children:t.result.download||"Ready to Download"})})]}),(0,a.jsx)("button",{onClick:()=>w(e,"rednote_video_".concat(r+1,".mp4"),"video"),disabled:p["video_rednote_video_".concat(r+1,".mp4")],className:"w-full px-6 py-3 bg-gradient-to-r from-green-500 to-emerald-500 text-white rounded-xl font-semibold hover:from-green-600 hover:to-emerald-600 transition-all duration-300 flex items-center justify-center shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed",children:p["video_rednote_video_".concat(r+1,".mp4")]?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-3"}),"Downloading Video..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mr-3 text-lg",children:"â¬ï¸"}),t.result.downloadMainVideo||"Download Video"," ",u.videoList.length>1?"".concat(r+1):""]})})]},r))})]})})]})]})})}},3448:function(e,r,t){"use strict";t.d(r,{Q:function(){return n},cn:function(){return o}});var a=t(1994),l=t(3335);let n="0x4AAAAAAB6-emcL2P_C3yL5";function o(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,l.m6)((0,a.W)(r))}}},function(e){e.O(0,[137,971,30,744],function(){return e(e.s=9010)}),_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.