PageSourceSearch

https://beadpattern.net/_next/static/chunks/7214.8c8eb9f92e0b4034.js

js beadpattern.net collected 2026-10-05 02:14:24 UTC 8,717 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7214],{4833:(e,t,l)=>{l.r(t),l.d(t,{default:()=>u});var a=l(3809),r=l(277),n=l(3181),i=l(963),o=l(7036),s=l(3447),d=l(3466);async function c(e,t,l){if(e.startsWith("data:")||e.startsWith("blob:")){if(null==l?void 0:l.stampBrand){let l=await x(e);if(l){p(l.href,t),URL.revokeObjectURL(l.href);return}}p(e,t);return}let a=null;try{let t=await fetch(e);if(t.ok){let e=await t.blob();e.type.startsWith("image/")&&(a=e)}}catch(e){a=null}if(!a&&/^https?:\/\//i.test(e)){let t=await fetch("/api/proxy-image?url=".concat(encodeURIComponent(e)));if(t.ok){let e=await t.blob();e.type.startsWith("image/")&&(a=e)}}if(!a)return void window.open(e,"_blank","noopener,noreferrer");(null==l?void 0:l.stampBrand)&&(a=await (0,d.yN)(a));let r=URL.createObjectURL(a);p(r,t),URL.revokeObjectURL(r)}async function x(e){try{let t=await fetch(e);if(!t.ok)return null;let l=await (0,d.yN)(await t.blob());return{href:URL.createObjectURL(l)}}catch(e){return null}}function p(e,t){let l=d
1ocument.createElement("a");l.href=e,l.download=t,document.body.appendChild(l),l.click(),l.remove()}function b(e){var t;if("pattern"===e.type)return"pattern";let l="".concat(e.url,"\n").concat((null==(t=e.metadata)?void 0:t.submissionOriginalImageSrc)||"");return"generation"===e.type||/\/ai\/[^/]+\/generated\//.test(l)?"generation":"upload"}function u(e){let{onUseImage:t,embedded:l=!1}=e,n=(0,o.c)("historyGallery"),d=(0,o.c)("editor"),{assets:x,currentWork:p,clearCurrentWork:u}=(0,i.H)(),{data:f}=(0,s.wV)(),[m,y]=(0,r.useState)([]),[w,v]=(0,r.useState)(!1),[j,N]=(0,r.useState)(null),[L,_]=(0,r.useState)(null);(0,r.useEffect)(()=>{(null==f?void 0:f.user)?(async()=>{v(!0),N(null);try{let e=await fetch("/api/user-assets");if(!e.ok)throw Error(n("fetchCloudError"));let t=await e.json();y(t)}catch(e){N(e.message)}finally{v(!1)}})():y([])},[null==f?void 0:f.user,n]);let k=(e=>{let t=new Set;return e.filter(e=>{let l=t.has(e.id);return t.add(e.id),!l})})([...x,...m]).sort((e,t)=>t.createdAt-e.createdAt),C=k.filter(e=>"generation"===b(e)),D=k.filter(e=>"upload"===b(e)),U=k.filter(e=>"pattern"===b(e));function I(e){return"generation"===e?n("aiGeneratedImage"):"pattern"===e?n("pixelDesignsTab"):n("uploadedImage")}async function R(e){if(!L){_(e.id);try{await c(e.url,function(e,t,l){let a=l.startsWith("data:image/jpeg")||l.includes(".jpg")||l.includes(".jpeg")?"jpg":l.includes(".webp")||l.startsWith("data:image/webp")?"webp":"png";return"beadpattern-".concat(e,"-").concat(t,".").concat(a)}(e.type,e.createdAt,e.url),{stampBrand:"generation"===b(e)})}finally{_(null)}}}function E(e){return!!((null==f?void 0:f.user)&&!x.some(t=>t.id===e.id))}let S=0===C.length&&0===D.length&&0===U.length&&!p;return(0,a.jsx)("div",{className:l?"h-full bg-white":"container mx-auto max-w-7xl px-4 py-8 bg-pixel-cream",children:(0,a.jsx)("div",{className:l?"h-full":"w-full px-6",children:(0,a.jsxs)("div",{className:l?"flex h-full min-h-0 flex-col bg-white p-4 sm:p-6":"bg-white p-6 border-4 border-pixel-berry shadow-[8px_8px_0px_rgba(139,71,137,0.3)] min-h-[500px] flex flex-col",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6 border-b-2 border-pixel-lavender pb-4",children:[(0,a.jsx)("h2",{className:"text-xl font-pixel text-pixel-berry",children:n("title")}),(0,a.jsxs)("div",{className:"text-xs font-pixel text-pixel-berry/70",children:[n("aiGenerationsTab")," (",C.length,") \xb7 ",n("pixelDesignsTab")," (",U.length,")"]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:[w&&(null==f?void 0:f.user)&&(0,a.jsxs)("div",{className:"text-center text-pixel-berry font-pixel py-8 flex flex-col items-center gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 border-4 border-pixel-berry border-t-transparent rounded-full animate-spin"}),n("loadingCloudAssets"),"..."]}),j&&(null==f?void 0:f.user)&&(0,a.jsxs)("div",{className:"text-center text-pixel-rose font-pixel py-8 bg-pixel-rose/10 border-2 border-pixel-rose m-4",children:[n("cloudAssetsError"),": ",j]}),S?(0,a.jsx)("div",{className:"col-span-full flex flex-col items-center justify-center py-12 text-pixel-berry/50 gap-4",children:(0,a.jsx)("p",{className:"font-pixel",children:n("noPixelDesigns")})}):(0,a.jsxs)("div",{className:"space-y-8",children:[p&&(0,a.jsx)(g,{asset:p,title:n("currentWork"),highlight:!0,cloudLabel:n("local"),downloadLabel:d("download"),primaryLabel:n("continueEditing"),secondaryLabel:n("clearLocal"),downloading:L===p.id,onPrimary:()=>t(p),onSecondary:()=>u(),onDownload:()=>void R(p)}),C.length>0&&(0,a.jsx)(h,{title:n("aiGenerationsTab"),emptyText:n("noAiGenerations"),assets:C,typeLabel:I,localLabel:n("local"),cloudLabel:n("cloud"),downloadLabel:d("download"),useLabel:n("useImage"),downloadingId:L,isCloud:E,onUse:t,onDownload:e=>void R(e)}),D.length>0&&(0,a.jsx)(h,{title:n("uploadedImage"),emptyText:n("noPixelDesigns"),assets:D,typeLabel:I,localLabel:n("local"),cloudLabel:n("cloud"),downloadLabel:d("download"),useLabel:n("useImage"),downloadingId:L,isCloud:E,onUse:t,onDownload:e=>void R(e)}),(0,a.jsx)(h,{title:n("pixelDesignsTab"),emptyText:n("noPixelDesigns"),assets:U,typeLabel:I,localLabel:n("local"),cloudLabel:n("cloud"),downloadLabel:d("download"),useLabel:n("useImage"),downloadingId:L,isCloud:E,onUse:t,onDownload:e=>void R(e)})]})]})]})})})}function h(e){let{title:t,emptyText:l,assets:r,typeLabel:n,localLabel:i,cloudLabel:o,downloadLabel:s,useLabel:d,downloadingId:c,isCloud:x,onUse:p,onDownload:b}=e;return(0,a.jsxs)("section",{children:[(0,a.jsx)("h3",{className:"mb-3 font-pixel text-sm text-pixel-berry",children:t}),0===r.length?(0,a.jsx)("p",{className:"font-pixel text-xs text-pixel-berry/50 py-4",children:l}):(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6",children:r.map(e=>{var t;return(0,a.jsx)(g,{asset:e,title:(null==(t=e.metadata)?void 0:t.grid)?"".concat(n(e.type)," ").concat(e.metadata.grid):n(e.type),cloudLabel:x(e)?o:i,downloadLabel:s,primaryLabel:d,downloading:c===e.id,onPrimary:()=>p(e),onDownload:()=>b(e)}
1,e.id)})})]})}function g(e){let{asset:t,title:l,highlight:r,cloudLabel:i,downloadLabel:o,primaryLabel:s,secondaryLabel:d,downloading:c,onPrimary:x,onSecondary:p,onDownload:b}=e;return(0,a.jsxs)("div",{className:r?"group border-2 border-green-500 bg-green-50/30 p-3 shadow-[4px_4px_0px_rgba(0,0,0,0.1)] flex flex-col h-full relative overflow-hidden max-w-sm":"group border-2 border-pixel-lavender bg-white p-3 shadow-[4px_4px_0px_rgba(0,0,0,0.1)] hover:shadow-[6px_6px_0px_rgba(139,71,137,0.2)] hover:border-pixel-berry transition-all duration-200 flex flex-col h-full",children:[r&&(0,a.jsx)("div",{className:"absolute top-0 left-0 bg-green-500 text-white text-[10px] px-2 py-1 font-pixel z-10",children:l}),(0,a.jsxs)("div",{className:"relative aspect-square mb-3 overflow-hidden ".concat(r?"bg-white border-2 border-dashed border-green-400 mt-4":"bg-pixel-cream border-2 border-dashed border-pixel-lavender"),children:[(0,a.jsx)("img",{src:t.url,alt:"",className:"w-full h-full object-contain p-2"}),(0,a.jsx)("div",{className:"absolute top-1 right-1",children:(0,a.jsx)("span",{className:r?"bg-pixel-lavender text-pixel-berry text-[10px] px-1.5 py-0.5 font-pixel":"pattern"===t.type?"bg-pixel-berry text-white text-[10px] px-1.5 py-0.5 font-pixel":"bg-pixel-lavender text-pixel-berry text-[10px] px-1.5 py-0.5 font-pixel",children:i})})]}),(0,a.jsxs)("div",{className:"mt-auto space-y-2",children:[!r&&(0,a.jsx)("p",{className:"text-xs text-pixel-berry/70 font-sans truncate px-1",title:l,children:l}),(0,a.jsx)("p",{className:"text-[10px] text-gray-400 font-sans px-1",children:new Date(t.createdAt).toLocaleString()}),(0,a.jsxs)("div",{className:d?"grid grid-cols-2 gap-2":"space-y-2",children:[(0,a.jsx)("button",{type:"button",onClick:x,className:r?"w-full bg-green-500 text-white font-pixel text-[10px] py-2 border-2 border-green-600 shadow-[2px_2px_0px_rgba(0,0,0,0.1)] hover:-translate-y-0.5 transition-all":"w-full bg-white text-pixel-berry font-pixel text-xs py-2 border-2 border-pixel-berry shadow-[2px_2px_0px_rgba(0,0,0,0.2)] hover:bg-pixel-berry hover:text-white hover:-translate-y-0.5 transition-all",children:s}),d&&p&&(0,a.jsx)("button",{type:"button",onClick:p,className:"w-full bg-white text-red-500 font-pixel text-[10px] py-2 border-2 border-red-200 hover:border-red-500 hover:bg-red-50 transition-all",children:d})]}),(0,a.jsxs)("button",{type:"button",disabled:c,onClick:b,className:"w-full h-8 border-2 border-pixel-berry bg-white text-pixel-berry font-pixel text-[11px] inline-flex items-center justify-center gap-1 disabled:opacity-60",children:[(0,a.jsx)(n.f,{className:"w-3.5 h-3.5","aria-hidden":!0}),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.