Files
Sisyphus (主代理) 02762400fb chore: 项目基线提交 - 拼豆图纸生成器 V1.0 核心代码
- 前端: React+Vite 首页/AI专区, 算法库(MARD色板/量化/背景去除), API对接
- 后端: Express+SQLite, 兑换码/订单/支付/chibi生成, 风控+云端同步
- CI/CD: GitHub Actions + Docker + nginx 配置
- 文档: PRD/DESIGN/LAUNCH/ROADMAP/E2E/竞品对照等 15 份
- 工程: 任务看板(taskboard) + 健康巡检(agent-health) + Git流程(gitflow)
2026-08-13 21:40:27 +08:00

3 lines
40 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return i}});let r=e.r(71645);function i(e,t){let n=(0,r.useRef)(null),i=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(n.current=s(e,r)),t&&(i.current=s(t,r))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},95057,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=e.r(90809)._(e.r(98183)),a=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:n}=e,r=e.protocol||"",i=e.pathname||"",l=e.hash||"",o=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),o&&"object"==typeof o&&(o=String(s.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||a.test(r))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),i=i.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${r}${c}${i}${d}${l}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return s}});let r=e.r(18967),i=e.r(52817);function s(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,i.hasBasePath)(n.pathname)}catch(e){return!1}}},84508,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},22016,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return b},useLinkStatus:function(){return j}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=e.r(90809),a=e.r(43476),l=s._(e.r(71645)),o=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),f=e.r(5550);e.r(33525);let p=e.r(88540),h=e.r(91949),m=e.r(73668),g=e.r(9396);function b(t){var n,r;let i,s,b,[j,v]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),y=(0,l.useRef)(null),{href:w,as:S,children:_,prefetch:C=null,passHref:O,replace:R,shallow:E,scroll:P,onClick:N,onMouseEnter:k,onTouchStart:I,legacyBehavior:L=!1,onNavigate:T,transitionTypes:M,ref:U,unstable_dynamicOnHover:$,...z}=t;i=_,L&&("string"==typeof i||"number"==typeof i)&&(i=(0,a.jsx)("a",{children:i}));let A=l.default.useContext(c.AppRouterContext),D=!1!==C,B=!1!==C?null===(r=C)||"auto"===r?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,F="string"==typeof(n=S||w)?n:(0,o.formatUrl)(n);if(L){if(i?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=l.default.Children.only(i)}let W=L?s&&"object"==typeof s&&s.ref:U,X=l.default.useCallback(e=>(null!==A&&(y.current=(0,h.mountLinkInstance)(e,F,A,B,D,v)),()=>{y.current&&((0,h.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,h.unmountPrefetchableInstance)(e)}),[D,F,A,B,v]),q={ref:(0,d.useMergedRef)(X,W),onClick(t){L||"function"!=typeof N||N(t),L&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!A||t.defaultPrevented||function(t,n,r,i,s,a,o){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(n)){i&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);l.default.startTransition(()=>{u(n,i?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,o)})}}(t,F,y,R,P,T,M)},onMouseEnter(e){L||"function"!=typeof k||k(e),L&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),A&&D&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){L||"function"!=typeof I||I(e),L&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),A&&D&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,u.isAbsoluteUrl)(F)?q.href=F:L&&!O&&("a"!==s.type||"href"in s.props)||(q.href=(0,f.addBasePath)(F)),b=L?l.default.cloneElement(s,q):(0,a.jsx)("a",{...z,...q,children:i}),(0,a.jsx)(x.Provider,{value:j,children:b})}e.r(84508);let x=(0,l.createContext)(h.IDLE_LINK_STATUS),j=()=>(0,l.useContext)(x);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},88143,(e,t,n)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:n,blurHeight:i,blurDataURL:s,objectFit:a}){let l=n?40*n:e,o=i?40*i:t,c=l&&o?`viewBox='0 0 ${l} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${c}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${c?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${s}'/%3E%3C/svg%3E`}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},87690,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return s},imageConfigDefault:function(){return a}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=["default","imgix","cloudinary","akamai","custom"],a={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},8927,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImgProps",{enumerable:!0,get:function(){return c}}),e.r(33525);let r=e.r(43369),i=e.r(88143),s=e.r(87690),a=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function o(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function c({src:e,sizes:t,unoptimized:n=!1,priority:d=!1,preload:u=!1,loading:f,className:p,quality:h,width:m,height:g,fill:b=!1,style:x,overrideSrc:j,onLoad:v,onLoadingComplete:y,placeholder:w="empty",blurDataURL:S,fetchPriority:_,decoding:C="async",layout:O,objectFit:R,objectPosition:E,lazyBoundary:P,lazyRoot:N,...k},I){var L;let T,M,U,{imgConf:$,showAltText:z,blurComplete:A,defaultLoader:D}=I,B=$||s.imageConfigDefault;if("allSizes"in B)T=B;else{let e=[...B.deviceSizes,...B.imageSizes].sort((e,t)=>e-t),t=B.deviceSizes.sort((e,t)=>e-t),n=B.qualities?.sort((e,t)=>e-t);T={...B,allSizes:e,deviceSizes:t,qualities:n}}if(void 0===D)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let F=k.loader||D;delete k.loader,delete k.srcSet;let W="__next_img_default"in F;if(W){if("custom"===T.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=F;F=t=>{let{config:n,...r}=t;return e(r)}}if(O){"fill"===O&&(b=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[O];e&&(x={...x,...e});let n={responsive:"100vw",fill:"100vw"}[O];n&&!t&&(t=n)}let X="",q=o(m),G=o(g);if((L=e)&&"object"==typeof L&&(l(L)||void 0!==L.src)){let t=l(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(M=t.blurWidth,U=t.blurHeight,S=S||t.blurDataURL,X=t.src,!b)if(q||G){if(q&&!G){let e=q/t.width;G=Math.round(t.height*e)}else if(!q&&G){let e=G/t.height;q=Math.round(t.width*e)}}else q=t.width,G=t.height}let V=!d&&!u&&("lazy"===f||void 0===f);(!(e="string"==typeof e?e:X)||e.startsWith("data:")||e.startsWith("blob:"))&&(n=!0,V=!1),T.unoptimized&&(n=!0),W&&!T.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(n=!0);let H=o(h),K=Object.assign(b?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:R,objectPosition:E}:{},z?{}:{color:"transparent"},x),J=A||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,i.getImageBlurSvg)({widthInt:q,heightInt:G,blurWidth:M,blurHeight:U,blurDataURL:S||"",objectFit:K.objectFit})}")`:`url("${w}")`,Q=a.includes(K.objectFit)?"fill"===K.objectFit?"100% 100%":"cover":K.objectFit,Y=J?{backgroundSize:Q,backgroundPosition:K.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:J}:{},Z=function({config:e,src:t,unoptimized:n,width:i,quality:s,sizes:a,loader:l}){if(n){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,r.getDeploymentId)();if(e){let n=t.indexOf("?");if(-1!==n){let r=new URLSearchParams(t.slice(n+1));r.get("dpl")||(r.append("dpl",e),t=t.slice(0,n)+"?"+r.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:c}=function({deviceSizes:e,allSizes:t},n,r){if(r){let n=/(^|\s)(1?\d?\d)vw/g,i=[];for(let e;e=n.exec(r);)i.push(parseInt(e[2]));if(i.length){let n=.01*Math.min(...i);return{widths:t.filter(t=>t>=e[0]*n),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof n?{widths:e,kind:"w"}:{widths:[...new Set([n,2*n].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,i,a),d=o.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:o.map((n,r)=>`${l({config:e,src:t,quality:s,width:n})} ${"w"===c?n:r+1}${c}`).join(", "),src:l({config:e,src:t,quality:s,width:o[d]})}}({config:T,src:e,unoptimized:n,width:q,quality:H,sizes:t,loader:F}),ee=V?"lazy":f;return{props:{...k,loading:ee,fetchPriority:_,width:q,height:G,decoding:C,className:p,style:{...K,...Y},sizes:Z.sizes,srcSet:Z.srcSet,src:j||Z.src},meta:{unoptimized:n,preload:u||d,placeholder:w,fill:b}}}},98879,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return l}});let r=e.r(71645),i="u"<typeof window,s=i?()=>{}:r.useLayoutEffect,a=i?()=>{}:r.useEffect;function l(e){let{headManager:t,reduceComponentsToState:n}=e;function l(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(e))}}return i&&(t?.mountedInstances?.add(e.children),l()),s(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),s(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},25633,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return m},defaultHead:function(){return u}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=e.r(55682),a=e.r(90809),l=e.r(43476),o=a._(e.r(71645)),c=s._(e.r(98879)),d=e.r(42732);function u(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(33525);let p=["name","httpEquiv","charSet","itemProp"];function h(e){let t,n,r,i;return e.reduce(f,[]).reverse().concat(u().reverse()).filter((t=new Set,n=new Set,r=new Set,i={},e=>{let s=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let n=e.key.slice(e.key.indexOf("$")+1);t.has(n)?s=!1:t.add(n)}switch(e.type){case"title":case"base":n.has(e.type)?s=!1:n.add(e.type);break;case"meta":for(let t=0,n=p.length;t<n;t++){let n=p[t];if(e.props.hasOwnProperty(n))if("charSet"===n)r.has(n)?s=!1:r.add(n);else{let t=e.props[n],r=i[n]||new Set;("name"!==n||!a)&&r.has(t)?s=!1:(r.add(t),i[n]=r)}}}return s})).reverse().map((e,t)=>{let n=e.key||t;return o.default.cloneElement(e,{key:n})})}let m=function({children:e}){let t=(0,o.useContext)(d.HeadManagerContext);return(0,l.jsx)(c.default,{reduceComponentsToState:h,headManager:t,children:e})};("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18556,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ImageConfigContext",{enumerable:!0,get:function(){return s}});let r=e.r(55682)._(e.r(71645)),i=e.r(87690),s=r.default.createContext(i.imageConfigDefault)},65856,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(55682)._(e.r(71645)).default.createContext(null)},70965,(e,t,n)=>{"use strict";function r(e,t){let n=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e,t.qualities[0]):n}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"findClosestQuality",{enumerable:!0,get:function(){return r}})},1948,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let r=e.r(70965),i=e.r(43369);function s({config:e,src:t,width:n,quality:a}){let l=(0,i.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")){let e=t.indexOf("?");if(-1!==e){let n=new URLSearchParams(t.slice(e+1)),r=n.get("dpl");if(r){l=r,n.delete("dpl");let i=n.toString();t=t.slice(0,e)+(i?"?"+i:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let o=(0,r.findClosestQuality)(a,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${n}&q=${o}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}s.__next_img_default=!0;let a=s},5500,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Image",{enumerable:!0,get:function(){return v}});let r=e.r(55682),i=e.r(90809),s=e.r(43476),a=i._(e.r(71645)),l=r._(e.r(74080)),o=r._(e.r(25633)),c=e.r(8927),d=e.r(87690),u=e.r(18556);e.r(33525);let f=e.r(65856),p=r._(e.r(1948)),h=e.r(18581),m={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function g(e,t,n,r,i,s,a){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),n?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,i=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function b(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let x=(0,a.forwardRef)(({src:e,srcSet:t,sizes:n,height:r,width:i,decoding:l,className:o,style:c,fetchPriority:d,placeholder:u,loading:f,unoptimized:p,fill:m,onLoadRef:x,onLoadingCompleteRef:j,setBlurComplete:v,setShowAltText:y,sizesInput:w,onLoad:S,onError:_,...C},O)=>{let R=(0,a.useCallback)(e=>{e&&(_&&(e.src=e.src),e.complete&&g(e,u,x,j,v,p,w))},[e,u,x,j,v,_,p,w]),E=(0,h.useMergedRef)(O,R);return(0,s.jsx)("img",{...C,...b(d),loading:f,width:i,height:r,decoding:l,"data-nimg":m?"fill":"1",className:o,style:c,sizes:n,srcSet:t,src:e,ref:E,onLoad:e=>{g(e.currentTarget,u,x,j,v,p,w)},onError:e=>{y(!0),"empty"!==u&&v(!0),_&&_(e)}})});function j({isAppRouter:e,imgAttributes:t}){let n={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...b(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,n),null):(0,s.jsx)(o.default,{children:(0,s.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...n},"__nimg-"+t.src+t.srcSet+t.sizes)})}let v=(0,a.forwardRef)((e,t)=>{let n=(0,a.useContext)(f.RouterContext),r=(0,a.useContext)(u.ImageConfigContext),i=(0,a.useMemo)(()=>{let e=m||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t),i=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n,qualities:i,localPatterns:"u"<typeof window?r?.localPatterns:e.localPatterns}},[r]),{onLoad:l,onLoadingComplete:o}=e,h=(0,a.useRef)(l);(0,a.useEffect)(()=>{h.current=l},[l]);let g=(0,a.useRef)(o);(0,a.useEffect)(()=>{g.current=o},[o]);let[b,v]=(0,a.useState)(!1),[y,w]=(0,a.useState)(!1),{props:S,meta:_}=(0,c.getImgProps)(e,{defaultLoader:p.default,imgConf:i,blurComplete:b,showAltText:y});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{...S,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:h,onLoadingCompleteRef:g,setBlurComplete:v,setShowAltText:w,sizesInput:e.sizes,ref:t}),_.preload?(0,s.jsx)(j,{isAppRouter:!n,imgAttributes:S}):null]})});("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},94909,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return d},getImageProps:function(){return c}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=e.r(55682),a=e.r(8927),l=e.r(5500),o=s._(e.r(1948));function c(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let d=l.Image},57688,(e,t,n)=>{t.exports=e.r(94909)},8429,e=>{"use strict";async function t(e){if(e instanceof Blob)return e;let t=await fetch(e);if(!t.ok)throw Error("图片读取失败");return t.blob()}function n(e,t){let n=URL.createObjectURL(e),r=document.createElement("div");r.setAttribute("role","dialog"),r.setAttribute("aria-label","保存图片"),Object.assign(r.style,{position:"fixed",inset:"0",zIndex:"99999",background:"rgba(16,16,14,.94)",display:"flex",flexDirection:"column",alignItems:"center",padding:"max(18px,env(safe-area-inset-top)) 16px max(18px,env(safe-area-inset-bottom))",overflow:"auto",color:"#fff",WebkitOverflowScrolling:"touch"});let i=document.createElement("div");Object.assign(i.style,{width:"min(100%,720px)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",marginBottom:"12px"});let s=document.createElement("div");s.innerHTML='<b style="font-size:18px">长按下方图片保存到手机</b><div style="font-size:13px;opacity:.72;margin-top:4px">iPhone 选择“存储到照片”;微信内请长按图片,或点右上角在浏览器打开</div>';let a=document.createElement("button");a.textContent="关闭",Object.assign(a.style,{border:"0",borderRadius:"999px",padding:"10px 16px",fontWeight:"700",background:"#d7ff39",color:"#151511"}),i.append(s,a);let l=document.createElement("img");l.src=n,l.alt=t,Object.assign(l.style,{display:"block",width:"min(100%,720px)",height:"auto",maxHeight:"calc(100vh - 150px)",objectFit:"contain",background:"#fff",borderRadius:"14px",WebkitTouchCallout:"default",userSelect:"auto"});let o=document.createElement("div");o.textContent=t,Object.assign(o.style,{fontSize:"12px",opacity:".6",marginTop:"10px",wordBreak:"break-all"});let c=()=>{r.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)};return a.onclick=c,r.onclick=e=>{e.target===r&&c()},r.append(i,l,o),document.body.appendChild(r),"preview"}async function r(e,r){let i=await t(e),s=r.toLowerCase().endsWith(".png")?r:r+".png",a=new File([i],s,{type:i.type||"image/png"}),l=navigator.userAgent.toLowerCase();if((/iphone|ipad|ipod|android|mobile/.test(l)||navigator.maxTouchPoints>1&&window.innerWidth<1024)&&"function"==typeof navigator.share)try{if(!navigator.canShare||navigator.canShare({files:[a]}))return await navigator.share({files:[a],title:"保存图片"}),"shared"}catch(e){return e instanceof DOMException&&"AbortError"===e.name||console.warn("系统分享不可用,已切换到图片预览保存",e),n(i,s)}if(/micromessenger|weibo|qq\/|iphone|ipad|ipod/.test(l))return n(i,s);let o=URL.createObjectURL(i),c=document.createElement("a");return c.href=o,c.download=s,c.rel="noopener",c.style.display="none",document.body.appendChild(c),c.click(),c.remove(),window.setTimeout(()=>URL.revokeObjectURL(o),3e4),"downloaded"}e.s(["saveImageOnDevice",0,r])},31017,e=>{"use strict";var t=e.i(43476),n=e.i(57688),r=e.i(22016),i=e.i(8429),s=e.i(71645);let a=[{id:"landscape",name:"风景",beforeImage:"/chibi-comparisons/landscape-original.png",image:"/chibi-comparisons/landscape-pixel.jpg",badge:"SCENE",note:"山川、城市和旅行纪念",subtypes:[{id:"nature",name:"治愈自然",note:"山湖、森林、日落"},{id:"city",name:"城市夜景",note:"霓虹、街景、天际线"},{id:"landmark",name:"建筑地标",note:"旅行建筑与纪念地"}],tags:["保留天空层次","突出主体建筑","减少零碎纹理","保留光影氛围","纯色边框","高对比轮廓"]},{id:"person",name:"人物",beforeImage:"/chibi-comparisons/person-original.png",image:"/chibi-comparisons/person-pixel.jpg",badge:"PORTRAIT",note:"五官、发型和穿搭清楚",subtypes:[{id:"big-eye",name:"萌系大眼",note:"大眼、圆脸、粗轮廓"},{id:"youth",name:"清爽少年",note:"自然五官、利落穿搭"},{id:"retro",name:"复古像素",note:"怀旧配色、游戏感"}],tags:["五官更清楚","保留衣服细节","保留发型","保留配饰","包含宠物","纯色背景"]},{id:"pet",name:"宠物",beforeImage:"/chibi-comparisons/pet-original.png",image:"/chibi-comparisons/pet-pixel.jpg",badge:"PET",note:"毛色、表情和品种特征",subtypes:[{id:"cat",name:"猫咪头像",note:"圆润脸型与花纹"},{id:"dog",name:"狗狗全身",note:"耳朵、四肢和毛色"},{id:"duo",name:"双宠互动",note:"两只宠物同框"}],tags:["眼睛更有神","保留毛色花纹","突出耳朵轮廓","保留项圈配饰","完整四肢","纯色背景"]},{id:"object",name:"物品",beforeImage:"/chibi-comparisons/object-original.png",image:"/chibi-comparisons/object-pixel.jpg",badge:"OBJECT",note:"手办、礼物和纪念物",subtypes:[{id:"toy",name:"手办玩具",note:"造型轮廓优先"},{id:"daily",name:"生活用品",note:"保留结构与材质"},{id:"gift",name:"礼物纪念",note:"突出包装和装饰"}],tags:["保留品牌外形","突出结构轮廓","减少反光渐变","保留小配件","居中构图","纯色背景"]},{id:"food",name:"食物",beforeImage:"/chibi-comparisons/food-original.png",image:"/chibi-comparisons/food-pixel.jpg",badge:"FOOD",note:"甜品、饮品和特色美食",subtypes:[{id:"dessert",name:"甜品蛋糕",note:"奶油与装饰清楚"},{id:"drink",name:"咖啡饮品",note:"杯型、分层和配料"},{id:"meal",name:"家常美食",note:"主食材清晰可辨"}],tags:["突出食物主体","保留食材层次","减少细碎装饰","增强色彩对比","俯拍构图","纯色背景"]}],l=[48,64,80,96],o=[16,24,32,40],c=["主体特写","半幅构图","完整构图"];e.s(["default",0,function(){let[e,d]=(0,s.useState)(a[2]),[u,f]=(0,s.useState)(a[2].subtypes[0]),[p,h]=(0,s.useState)(64),[m,g]=(0,s.useState)(24),[b,x]=(0,s.useState)("主体特写"),[j,v]=(0,s.useState)(a[2].tags.slice(0,3)),[y,w]=(0,s.useState)(""),[S,_]=(0,s.useState)(null),[C,O]=(0,s.useState)(null),[R,E]=(0,s.useState)(null),[P,N]=(0,s.useState)(!0),[k,I]=(0,s.useState)(!1),[L,T]=(0,s.useState)(""),[M,U]=(0,s.useState)(null),[$,z]=(0,s.useState)(""),[A,D]=(0,s.useState)(""),[B,F]=(0,s.useState)(!1),W=(0,s.useRef)(null),X=(0,s.useRef)(null),q=(0,s.useRef)(null),G=!!(R&&!P),V=(0,s.useMemo)(()=>Math.round(p*p*("主体特写"===b?.7:"半幅构图"===b?.6:.48)),[p,b]);async function H(e,t=!1){try{let t=await fetch("/api/codes/redeem",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})}),n=await t.json();if(!t.ok||!n.access)throw Error(n.error||"兑换失败");U(n.access),z(n.access.code),localStorage.setItem("perler-download-code",n.access.code),F(!1),D("")}catch(e){t||D(e instanceof Error?e.message:"兑换失败")}}function K(e,t){if(!e||!e.type.startsWith("image/"))return;if(e.size>0xc00000)return void T("图片不能超过 12MB");let n=URL.createObjectURL(e),r=new window.Image;r.onload=()=>{let e=Math.min(1,("source"===t?1400:1200)/Math.max(r.width,r.height)),i=document.createElement("canvas");i.width=Math.round(r.width*e),i.height=Math.round(r.height*e);let s=i.getContext("2d");if(!s){URL.revokeObjectURL(n),T("图片读取失败,请换一张重试");return}s.drawImage(r,0,0,i.width,i.height),URL.revokeObjectURL(n);let a=i.toDataURL("image/jpeg","source"===t?.88:.82);"source"===t?_(a):O(a),E(null),N(!0),T("")},r.onerror=()=>{URL.revokeObjectURL(n),T("图片读取失败,请换一张重试")},r.src=n}async function J(){if(!S||!M||k||G){M||F(!0);return}I(!0),T(""),E(null);try{let t=await fetch("/api/chibi/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:M.code,image:S,referenceImage:C,category:e.id,subtype:u.id,gridSize:p,colorCount:m,composition:b,detailTags:j,customPrompt:y.trim()})}),n=await t.json();if(!t.ok||!n.image||!n.access)throw Error(n.error||"生成失败,请稍后重试");E(n.image),N(!1),U(n.access),n.downloadGrant&&(sessionStorage.setItem("perler-ai-download-grant",n.downloadGrant),sessionStorage.setItem("perler-ai-download-code",n.access.code))}catch(e){T(e instanceof Error?e.message:"生成失败,请稍后重试")}finally{I(!1)}}async function Q(){if(R)try{await (0,i.saveImageOnDevice)(R,`${e.name}-${u.name}-${p}格-生成图.png`),N(!0)}catch(e){T(e instanceof Error?e.message:"图片保存失败,请重试")}}function Y(e){G&&(e.preventDefault(),document.querySelector(".saveGuard")?.scrollIntoView({behavior:"smooth",block:"center"}))}return(0,s.useEffect)(()=>{let e=localStorage.getItem("perler-download-code");e&&H(e,!0)},[]),(0,s.useEffect)(()=>{let e=e=>{G&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[G]),(0,s.useEffect)(()=>{if(!R)return;let e=window.setTimeout(()=>q.current?.scrollIntoView({behavior:"smooth",block:"start"}),120);return()=>window.clearTimeout(e)},[R]),(0,t.jsxs)("main",{className:"chibiPage beadChibiPage",children:[(0,t.jsxs)("nav",{className:"nav",children:[(0,t.jsxs)(r.default,{onClick:Y,className:"brand brandLink",href:"/",children:[(0,t.jsx)("span",{className:"brandMark",children:"P"}),(0,t.jsxs)("span",{children:["PERLER ",(0,t.jsx)("b",{children:"LAB"})]})]}),(0,t.jsxs)("div",{className:"navLinks",children:[(0,t.jsx)(r.default,{onClick:Y,href:"/",children:"图片转拼豆"}),(0,t.jsxs)(r.default,{className:"active",href:"/chibi",children:["AI拼豆专区 ",(0,t.jsx)("span",{children:"PRO"})]})]}),(0,t.jsxs)("div",{className:"chibiNavActions",children:[(0,t.jsx)(r.default,{onClick:Y,className:`mobileBackLink ${G?"needsSave":""}`,href:"/",children:G?"先保存图片":"← 普通拼豆"}),(0,t.jsxs)("div",{className:"navRight",children:[(0,t.jsx)("span",{className:"liveDot"})," 每次生成消耗 1 次权益"]})]})]}),(0,t.jsxs)("section",{className:"beadHero",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"eyebrow",children:"IMAGE TO PERLER"}),(0,t.jsxs)("h1",{children:["先选大类,再定细节,",(0,t.jsx)("br",{}),(0,t.jsx)("em",{children:"生成结果先保存。"})]})]}),(0,t.jsx)("p",{children:"每次 AI 成功生成扣 1 次;该作品转成正式拼豆图纸并首次下载免费。只有重新生成新作品才再次扣费。"})]}),G&&(0,t.jsxs)("div",{className:"saveGuard",children:[(0,t.jsx)("strong",{children:"⚠ 当前生成图片尚未保存"}),(0,t.jsx)("span",{children:"分类、风格、参数和上传按钮已锁定。请先到下方点击“保存图片并解锁”。"})]}),(0,t.jsxs)("section",{className:`beadBuilder ${G?"settingsLocked":""}`,children:[(0,t.jsxs)("div",{className:"beadConfig panel",children:[(0,t.jsxs)("div",{className:"configHead",children:[(0,t.jsx)("span",{children:"01"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("b",{children:"选择拼豆大类"}),(0,t.jsx)("small",{children:"先选用途,再选择更具体的成品方向"})]})]}),(0,t.jsx)("div",{className:"categoryTabs",children:a.map(n=>(0,t.jsxs)("button",{disabled:G,className:e.id===n.id?"selected":"",onClick:()=>{!G&&(d(n),f(n.subtypes[0]),v(n.tags.slice(0,3)),E(null))},children:[(0,t.jsx)("span",{children:n.name}),(0,t.jsx)("small",{children:n.note})]},n.id))}),(0,t.jsxs)("div",{className:"categoryShowcase",children:[e.beforeImage?(0,t.jsxs)("div",{className:"categoryCompare",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.default,{src:e.beforeImage,alt:`${e.name}原图`,fill:!0,sizes:"(max-width:720px) 42vw, 360px"}),(0,t.jsx)("span",{children:"原图"})]}),(0,t.jsx)("b",{children:"→"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.default,{src:e.image,alt:`${e.name}像素拼豆效果`,fill:!0,sizes:"(max-width:720px) 42vw, 360px"}),(0,t.jsx)("span",{children:"像素拼豆"})]})]}):(0,t.jsxs)("div",{className:"categorySingle",children:[(0,t.jsx)(n.default,{src:e.image,alt:`${e.name}像素拼豆示例`,fill:!0,sizes:"(max-width:720px) 90vw, 720px"}),(0,t.jsx)("span",{children:"像素拼豆示例"})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("b",{children:[e.name," · 默认像素拼豆风"]}),(0,t.jsx)("small",{children:e.beforeImage?"真实原图与转换后效果对比":"选择一个细分类别"}),(0,t.jsx)("div",{children:e.subtypes.map(e=>(0,t.jsxs)("button",{disabled:G,className:u.id===e.id?"active":"",onClick:()=>{f(e),E(null)},children:[(0,t.jsx)("b",{children:e.name}),(0,t.jsx)("span",{children:e.note})]},e.id))})]})]}),(0,t.jsxs)("div",{className:"configSection",children:[(0,t.jsxs)("div",{className:"configLabel",children:[(0,t.jsx)("b",{children:"图纸格数"}),(0,t.jsxs)("span",{children:[p," × ",p]})]}),(0,t.jsx)("p",{children:"格数越大细节越清楚,实际制作时间也更长。"}),(0,t.jsx)("div",{className:"optionRow four",children:l.map(e=>(0,t.jsxs)("button",{disabled:G,className:p===e?"active":"",onClick:()=>{h(e),E(null)},children:[e,(0,t.jsx)("small",{children:48===e?"简单":64===e?"推荐":80===e?"精细":"高清"})]},e))})]}),(0,t.jsxs)("div",{className:"configSection",children:[(0,t.jsxs)("div",{className:"configLabel",children:[(0,t.jsx)("b",{children:"最大颜色数"}),(0,t.jsxs)("span",{children:[m," 色"]})]}),(0,t.jsx)("p",{children:"颜色越多还原度越高;颜色越少,备豆更简单。"}),(0,t.jsx)("div",{className:"optionRow four",children:o.map(e=>(0,t.jsxs)("button",{disabled:G,className:m===e?"active":"",onClick:()=>{g(e),E(null)},children:[e,(0,t.jsx)("small",{children:16===e?"省豆":24===e?"均衡":32===e?"细腻":"高还原"})]},e))})]}),(0,t.jsxs)("div",{className:"configSection",children:[(0,t.jsxs)("div",{className:"configLabel",children:[(0,t.jsx)("b",{children:"主体构图"}),(0,t.jsx)("span",{children:b})]}),(0,t.jsx)("div",{className:"optionRow three",children:c.map(e=>(0,t.jsx)("button",{disabled:G,className:b===e?"active":"",onClick:()=>{x(e),E(null)},children:e},e))})]}),(0,t.jsxs)("div",{className:"configSection",children:[(0,t.jsxs)("div",{className:"configLabel",children:[(0,t.jsx)("b",{children:"细节提示词"}),(0,t.jsx)("span",{children:"最多选 5 项"})]}),(0,t.jsx)("div",{className:"promptTags",children:e.tags.map(e=>(0,t.jsxs)("button",{disabled:G,className:j.includes(e)?"active":"",onClick:()=>{!G&&(v(t=>t.includes(e)?t.filter(t=>t!==e):t.length<5?[...t,e]:t),E(null))},children:[j.includes(e)?"✓ ":"+ ",e]},e))}),(0,t.jsx)("textarea",{disabled:G,maxLength:160,value:y,onChange:e=>{w(e.target.value),E(null)},placeholder:"补充希望保留的颜色、细节、姿势、背景……"}),(0,t.jsxs)("small",{className:"promptCount",children:[y.length,"/160"]}),(0,t.jsxs)("div",{className:"referenceUploadRow",children:[(0,t.jsxs)("button",{disabled:G,className:C?"hasReference":"",onClick:()=>X.current?.click(),children:[C?(0,t.jsx)("img",{src:C,alt:"风格示例图"}):(0,t.jsx)("strong",{children:"+"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("b",{children:C?"已添加风格示例图":"上传风格示例图(可选)"}),(0,t.jsx)("small",{children:C?"参考画风、配色和拼豆质感":"不会照搬示例主体"})]}),C&&(0,t.jsx)("i",{children:"更换"})]}),C&&(0,t.jsx)("button",{disabled:G,className:"removeReference",onClick:()=>{O(null),E(null)},children:"移除"})]}),(0,t.jsx)("input",{ref:X,className:"hiddenFileInput",type:"file",accept:"image/jpeg,image/png,image/webp",onChange:e=>K(e.target.files?.[0],"reference")})]})]}),(0,t.jsxs)("aside",{className:"beadPreview panel",children:[(0,t.jsxs)("div",{className:"previewTitle",children:[(0,t.jsx)("span",{children:"02"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("b",{children:"生成前确认"}),(0,t.jsxs)("small",{children:[e.name," · ",u.name]})]})]}),(0,t.jsxs)("div",{className:"selectedSample",children:[(0,t.jsx)(n.default,{src:e.image,alt:`${e.name}示例`,fill:!0,sizes:"(max-width:720px) 90vw, 420px"}),(0,t.jsx)("span",{children:"默认像素效果"})]}),(0,t.jsxs)("div",{className:"specSummary",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"类别"}),(0,t.jsx)("b",{children:e.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"细分"}),(0,t.jsx)("b",{children:u.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"图纸"}),(0,t.jsxs)("b",{children:[p,"×",p]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"预计"}),(0,t.jsxs)("b",{children:["约 ",V," 颗"]})]})]}),(0,t.jsxs)("button",{disabled:G,className:`portraitMini ${S?"hasImage":""}`,onClick:()=>W.current?.click(),children:[S?(0,t.jsx)("img",{src:S,alt:"已上传原图"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{children:"+"}),(0,t.jsx)("b",{children:"上传需要转换的原图"}),(0,t.jsx)("small",{children:"主体清楚、光线自然效果更好"})]}),S&&(0,t.jsx)("i",{children:"点击更换"})]}),(0,t.jsx)("input",{ref:W,className:"hiddenFileInput",type:"file",accept:"image/jpeg,image/png,image/webp",onChange:e=>K(e.target.files?.[0],"source")}),(0,t.jsxs)("div",{className:"paidGenerateNote",children:[(0,t.jsx)("b",{children:M?`剩余 ${M.remainingUses} 次生成权益`:"AI 生成属于付费功能"}),(0,t.jsx)("span",{children:"成功生成扣 1 次;本作品转图纸和首次下载免费,失败不扣。"})]}),(0,t.jsx)("button",{className:"generateBeadPreview",disabled:!S||k||G,onClick:J,children:k?"正在生成,请勿离开页面…":M?S?"消耗 1 次,开始生成 →":"请先上传原图":"兑换后生成 →"}),L&&(0,t.jsx)("p",{className:"chibiError",children:L})]})]}),R&&(0,t.jsxs)("section",{ref:q,className:`beadResult panel ${!P?"unsaved":"saved"}`,children:[(0,t.jsxs)("div",{className:"resultImage",children:[(0,t.jsx)("img",{src:R,alt:"AI生成的拼豆预览"}),(0,t.jsx)("span",{children:P?"已保存":"待保存"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"resultEyebrow",children:"YOUR PERLER RESULT"}),(0,t.jsx)("h2",{children:P?"图片已保存,可以继续操作":"先保存,再切换任何设置"}),(0,t.jsx)("p",{children:P?"现在可以转换成正式图纸,或回到上方更换分类和参数。":"浏览器不会长期保存生成结果。为避免图片丢失,分类、参数和导航已经锁定。"}),(0,t.jsxs)("div",{className:"resultSpecs",children:[(0,t.jsx)("span",{children:e.name}),(0,t.jsx)("span",{children:u.name}),(0,t.jsxs)("span",{children:[p,"×",p]}),(0,t.jsxs)("span",{children:[m," 色"]})]}),P?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:function(){if(R&&P)try{sessionStorage.setItem("perler-chibi-image",R),sessionStorage.setItem("perler-chibi-name",`${e.name}-${u.name}-${p}格`),sessionStorage.setItem("perler-chibi-size",String(p)),sessionStorage.setItem("perler-chibi-colors",String(m)),location.href="/"}catch{T("图片暂时无法传到拼豆区,请先下载后再上传")}},children:"转换成正式拼豆图纸 →"}),(0,t.jsx)("button",{className:"retryButton",onClick:()=>{E(null),N(!0)},children:"继续调整设置"})]}):(0,t.jsx)("button",{className:"saveResultButton",onClick:Q,children:"↓ 保存图片并解锁调整"})]})]}),R&&(0,t.jsx)("button",{className:"mobileResultJump",onClick:()=>q.current?.scrollIntoView({behavior:"smooth",block:"start"}),children:"查看生成效果 ↑"}),(0,t.jsxs)("section",{className:"beadPromise",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("b",{children:"分类更准确"}),(0,t.jsx)("span",{children:"不同主体使用不同提示词,风景、宠物和食物不再套用人物规则。"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("b",{children:"生成按次计费"}),(0,t.jsx)("span",{children:"每次成功生成扣 1 次权益,失败不扣,避免无限消耗模型费用。"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("b",{children:"结果防丢失"}),(0,t.jsx)("span",{children:"未保存时锁住所有切换操作,并在关闭页面前再次提醒。"})]})]}),(0,t.jsxs)("footer",{children:[(0,t.jsx)("span",{children:"PERLER LAB · AI 拼豆专区"}),(0,t.jsx)(r.default,{onClick:Y,href:"/",children:"返回图片转拼豆 →"})]}),B&&(0,t.jsx)("div",{className:"generationUnlockOverlay",children:(0,t.jsxs)("section",{children:[(0,t.jsx)("button",{onClick:()=>F(!1),children:"×"}),(0,t.jsx)("span",{className:"eyebrow",children:"GENERATION ACCESS"}),(0,t.jsx)("h2",{children:"兑换后才能生成"}),(0,t.jsx)("p",{children:"每成功生成 1 张图片消耗 1 次使用权益;生成失败不扣次数。"}),(0,t.jsx)("input",{value:$,onChange:e=>z(e.target.value.toUpperCase()),placeholder:"输入兑换码,例如 PB-XXXXX-XXXXX"}),(0,t.jsx)("button",{className:"unlockSubmit",disabled:!$.trim(),onClick:()=>void H($),children:"立即兑换"}),A&&(0,t.jsx)("small",{children:A}),(0,t.jsx)(r.default,{href:"/",children:"没有兑换码?返回首页购买套餐"})]})})]})}])}]);