1import{T as Ee,bh as Ie,a6 as Te,a1 as Ue,ab as Oe,a3 as ze,V as m,ci as Q,ai as w,W as e,bc as We,an as be,a0 as qe}from"./index-B3jPZcUH.js";import{u as Fe}from"./usePageTitle-CZzhwc_L.js";import{a as Be}from"./tierHelpers-DGdA0lPy.js";import{S as Ve}from"./StorePaywallModal-D-ve3oZ5.js";import{r as He}from"./storeDetection-CHX9lQq2.js";import{A as Ge}from"./arrow-left-Qd_lVbB-.js";import{C as Qe}from"./chevron-left-kLwr8SAe.js";import{C as Ke}from"./chevron-right-Ck0rQpuN.js";import{C as Ye}from"./chevron-up-ARO-rDa3.js";import{C as Je}from"./chevron-down-Cx4FUH_U.js";import"./useBillingCheckout-CFj6hTdd.js";import"./stripe-Bd4M3cPo.js";import"./pure-CU_jKGao.js";import"./CreditSelector-5R9RlkAt.js";/** 2 * @license lucide-react v0.303.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ke=Ee("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]),j={shopify:"Shopify",woocommerce:"WooCommerce",wix:"Wix"},Xe=o=>o==="woocommerce"?e.jsx("img",{src:"/logo-woocommerce.png",alt:"WooCommerce",className:"h-3 w-auto object-contain dark:brightness-0 dark:invert"}):o==="wix"?e.jsx("span",{className:"font-sans font-bold text-[12px] leading-none text-ink dark:text-white",children:"Wix"}):e.jsx("img",{src:"/logo-shopify.png",alt:"Shopify",className:"h-3 w-auto object-contain dark:brightness-0 dark:invert"}),Ze=o=>{const d=o.store||{},g=o.platform_product_id;if(!d.shop_domain||!g)return null;const k=String(d.shop_domain).replace(/^https?:\/\//,"").replace(/\/+$/,"");return d.platform==="shopify"?`https://${k}/admin/products/${g}`:d.platform==="woocommerce"?`https://${k}/wp-admin/post.php?post=${g}&action=edit`:null},W=o=>{try{return decodeURIComponent(new URL(o).pathname.split("/").pop()||"")}catch{return String(o||"").split("/").pop()||""}},we=(o,d)=>d==null||Number.isNaN(Number(d))?null:`${o||"USD"} ${Number(d).toFixed(2)}`,y=({title:o,aside:d,children:g,className:k=""})=>e.jsxs("div",{className:`flex flex-col gap-3 p-[18px] rounded-[10px] bg-sidebar dark:bg-white/5 ${k}`,children:[(o||d)&&e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-ink/45 dark:text-white/45",children:o}),d]}),g]}),K=({children:o})=>e.jsx("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.1em] px-[9px] py-1 rounded-full border border-sage/40 text-sage-deep dark:text-sage whitespace-nowrap",children:o}),c=({label:o,value:d,tone:g,top:k=!1,py:q="py-2.5",size:p="text-[13px]"})=>e.jsxs("div",{className:`flex ${k?"items-start":"items-center"} justify-between gap-4 ${q} border-t border-ink/[0.07] dark:border-white/[0.08]`,children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.1em] text-ink/45 dark:text-white/45 flex-none",children:o}),e.jsx("span",{className:`${p} text-right break-words ${g||"text-ink/85 dark:text-white/85"}`,children:d??"â"})]}),ut=()=>{var he,ue,me,ge,fe;Fe("Product");const{productId:o}=Ie(),d=Te(),{user:g}=Ue(),{selectProduct:k,updateProduct:q}=Oe(),{t:p,lang:je}=ze(),a=je==="fr",[r,F]=m.useState(null),[ve,Y]=m.useState({}),[Ne,J]=m.useState(!0),[X,Z]=m.useState([]),[R,ee]=m.useState(0),[x,f]=m.useState(0),[b,te]=m.useState(!1),[ye,B]=m.useState(!1),[ae,$e]=m.useState(!1),A=t=>{Z(((t==null?void 0:t.images)||[]).map((s,n)=>n)),ee(0)},se=async({quiet:t=!1}={})=>{var u;const s=await Q.get(o);F(s.product),Y(s.usage||{}),A(s.product);const n=(((u=s.product)==null?void 0:u.images)||[]).length;return f(L=>t?Math.min(L,Math.max(0,n-1)):0),s};m.useEffect(()=>{let t=!1;return(async()=>{try{J(!0);const s=await Q.get(o);t||(F(s.product),Y(s.usage||{}),A(s.product),f(0))}catch{if(t)return;w.error(p("productDetail.notFound")),d("/my-products")}finally{t||J(!1)}})(),()=>{t=!0}},[o]);const re=((r==null?void 0:r.images)||[]).map(t=>({...t,src:t.src||t.url})),v=X.map(t=>re[t]).filter(t=>t&&t.src),i=v.length,l=i?v[Math.min(x,i-1)]:null,M=((he=r==null?void 0:r.store)==null?void 0:he.shop_name)||((ue=r==null?void 0:r.store)==null?void 0:ue.shop_domain)||p("myProducts.storeFallback"),h=((me=r==null?void 0:r.store)==null?void 0:me.platform)||"shopify",$=X.some((t,s)=>t!==s),V=!ae&&re.every(t=>
6t.id!=null),H=(t,s)=>{t<0||t>=i||s<0||s>=i||t===s||(Z(n=>{const u=n.slice(),[L]=u.splice(t,1);return u.splice(s,0,L),u}),ee(n=>n+1),f(n=>n===t?s:t<n&&s>=n?n-1:t>n&&s<=n?n+1:n))},_e=async()=>{if(!(!r||b)){if(!Be(g)){B(!0);return}try{te(!0);const t=await Q.reorder(r.id,v.map(s=>String(s.id)));t!=null&&t.product&&(F(s=>({...s,...t.product,store:t.product.store||s.store})),A(t.product)),w.success(a?`Nouvel ordre envoyé à ${j[h]}.`:`New order pushed to ${j[h]}.`)}catch(t){switch(t.code){case"PUBLISH_REQUIRES_UPGRADE":B(!0);break;case"REORDER_UNSUPPORTED":$e(!0),A(r),w.error(a?`${j[h]} ne permet pas de réordonner les photos de cette boutique.`:`${j[h]} does not allow reordering photos for this store.`);break;case"GALLERY_STALE":w.error(a?"La galerie a changé sur la boutique. Page rechargée, réessaie.":"The gallery changed on the store. Page refreshed, try again."),se({quiet:!0}).catch(()=>{});break;case"MIRROR_FAILED":w.error(a?"Ordre envoyé à la boutique, mais la page nâa pas pu se rafraîchir. Synchronise la boutique.":"Order pushed to the store, but the page could not refresh. Sync the store."),se({quiet:!0}).catch(()=>{});break;case"AUTH_REQUIRED":w.error(a?"Session expirée, reconnecte-toi.":"Session expired, sign in again.");break;default:w.error(t.message||(a?"Impossible dâenvoyer le nouvel ordre.":"Could not push the new order."))}}finally{te(!1)}}},_=a?"Le nouvel ordre des photos nâa pas été envoyé à la boutique. Quitter quand même ?":"The new photo order has not been pushed to the store. Leave anyway?",G=m.useCallback(t=>{var n,u,L;if(!$)return;const s=(u=(n=t.target).closest)==null?void 0:u.call(n,"a[href]");!s||s.target==="_blank"||(L=s.getAttribute("href"))!=null&&L.startsWith("#")||window.confirm(_)||(t.preventDefault(),t.stopPropagation())},[$,_]);m.useEffect(()=>{if(!$)return;const t=s=>(s.preventDefault(),s.returnValue=_,_);return window.addEventListener("beforeunload",t),document.addEventListener("click",G,!0),()=>{window.removeEventListener("beforeunload",t),document.removeEventListener("click",G,!0)}},[$,G,_]);const Se=t=>{!r||!t||$&&!window.confirm(_)||(k({imageUrl:t,productId:r.id,platformProductId:r.platform_product_id,productName:r.title,storeId:r.store_id,storeName:M,platform:h,detectionStatus:"analyzing"}),He({product:r,imageUrl:t,updateProduct:q}),d("/explore"),w.success(p("productDetail.productSelected")))},E=(t,s=!1)=>{if(!t)return null;const n=new Date(t);if(Number.isNaN(n.getTime()))return null;const u=n.toLocaleDateString(a?"fr-FR":"en-GB",{day:"numeric",month:"short",year:"numeric"});return s?`${u} · ${n.toLocaleTimeString(a?"fr-FR":"en-GB",{hour:"2-digit",minute:"2-digit"})}`:u},I=t=>{if(!t)return null;const s=Math.max(0,Math.round((Date.now()-new Date(t).getTime())/6e4));if(s<1)return a?"à lâinstant":"just now";if(s<60)return a?`il y a ${s} min`:`${s} min ago`;const n=Math.round(s/60);return n<24?a?`il y a ${n} h`:`${n} h ago`:a?`il y a ${Math.round(n/24)} j`:`${Math.round(n/24)} d ago`};if(Ne)return e.jsx("div",{className:"min-h-screen animate-pulse",children:e.jsxs("div",{className:"max-w-[1320px] mx-auto flex flex-col gap-6",children:[e.jsx("div",{className:"h-3 w-28 rounded bg-sidebar dark:bg-white/10"}),e.jsx("div",{className:"h-9 w-2/3 rounded bg-sidebar dark:bg-white/10"}),e.jsxs("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,1.25fr)_minmax(320px,400px)]",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"aspect-[4/3] rounded-[8px] bg-sidebar dark:bg-white/5"}),e.jsx("div",{className:"h-40 rounded-[10px] bg-sidebar dark:bg-white/5"})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"h-40 rounded-[10px] bg-sidebar dark:bg-white/5"}),e.jsx("div",{className:"h-56 rounded-[10px] bg-sidebar dark:bg-white/5"})]})]})]})});if(!r)return null;const T=r.status||"active",Ce=p(`myProducts.status.${T}`)||T,Pe=T==="active"||T==="publish",U=Ze(r),ne=String(r.tags||"").split(",").map(t=>t.trim()).filter(Boolean).slice(0,12),ie=r.description||"",Le=/<[a-z][\s\S]*>/i.test(ie),S=ie.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),oe=S?S.split(/\s+/).length:0,D=Array.isArray(r.variants)?r.variants:[],C=D[0]||{},O=r.inventory_quantity,z=v.filter(t=>!t.alt).length,N=l?ve[l.src]:null,le=[r.sku?`SKU ${r.sku}`:null,r.product_type||null,r.vendor||null,r.platform_updated_at?a?`mis à jour ${I(r.platform_updated_at)}`:`updated ${I(r.platform_updated_at)}`:r.synced_at?a?`synchro ${I(r.synced_at)}`:`synced ${I(r.synced_at)}
6`:null].filter(Boolean).join(" · "),Ae=D.length>1?`${D.length} · ${D.map(t=>t.title).filter(Boolean).slice(0,3).join(" / ")}`:D.length===1&&C.title&&C.title!==r.title?C.title:null,ce={shopify:{dims:!0,seo:!0,compareAt:!0,barcode:!0,vendor:!0},woocommerce:{dims:!1,seo:!1,compareAt:!0,barcode:!0,vendor:!1},wix:{dims:!0,seo:!0,compareAt:!1,barcode:!1,vendor:!0}},P=ce[h]||ce.shopify,de=r.seo||{},De=[...P.seo?[{label:a?"Titre SEO":"SEO title",value:de.title||null,max:60},{label:"Meta description",value:de.description||null,max:160}]:[],{label:a?"Handle URL":"URL handle",value:r.handle?`/${h==="woocommerce"?"product":"products"}/${r.handle}`:null,max:0}],xe="absolute top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-card/95 hover:bg-card shadow-[0_6px_18px_-8px_rgba(26,26,23,0.35)] flex items-center justify-center text-ink dark:bg-[#1a1b21]/95 dark:text-white",Re=t=>{const s=((t==null?void 0:t.alt)||W((t==null?void 0:t.src)||"").replace(/\.[a-z0-9]+$/i,"")||"image").toLowerCase();return s.length>28?`${s.slice(0,27)}â¦`:s},Me=t=>t===0?a?"Principale":"Main":`${a?"Case":"Slot"} ${t+1}`,pe=t=>`w-[22px] h-[17px] rounded-[4px] flex items-center justify-center bg-ink/5 dark:bg-white/10 transition-colors ${t?"text-ink/20 dark:text-white/20 cursor-default":"text-ink/60 hover:bg-sage-pill hover:text-sage-deep dark:text-white/60"}`;return e.jsxs("div",{className:"min-h-screen",children:[e.jsxs("div",{className:"max-w-[1320px] mx-auto flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 sm:gap-5",children:[e.jsxs(We,{to:"/my-products",className:"inline-flex items-center gap-[9px] font-mono text-[10.5px] uppercase tracking-[0.12em] text-ink/55 hover:text-ink dark:text-white/55 dark:hover:text-white transition-colors whitespace-nowrap",children:[e.jsx(Ge,{className:"w-3.5 h-3.5",strokeWidth:2}),e.jsx("span",{children:p("myProducts.title")})]}),e.jsxs("div",{className:"inline-flex items-center gap-2.5 sm:gap-[13px] min-w-0",children:[Xe(h),e.jsx("span",{"aria-hidden":!0,className:"hidden sm:block w-px h-3.5 bg-ink/15 dark:bg-white/15"}),e.jsx("span",{className:"hidden sm:inline text-[13px] text-ink/70 dark:text-white/70 truncate",children:M}),e.jsx("span",{className:`font-mono text-[9.5px] uppercase tracking-[0.12em] px-[9px] py-1 rounded-full whitespace-nowrap ${Pe?"bg-sage-pill text-sage-deep dark:bg-white/10 dark:text-white":"bg-ink/70 text-card"}`,children:Ce}),U&&e.jsxs("a",{href:U,target:"_blank",rel:"noopener noreferrer",className:"hidden sm:inline-flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-sage-deep hover:text-ink dark:text-sage dark:hover:text-white transition-colors whitespace-nowrap",children:[a?`Voir dans ${j[h]}`:`View in ${j[h]}`,e.jsx(ke,{className:"w-3 h-3",strokeWidth:2})]})]})]}),$&&e.jsxs("div",{className:"sticky top-2 z-30 flex flex-col sm:flex-row sm:items-center gap-2.5 sm:gap-4 px-4 py-2.5 sm:py-2 rounded-[10px] bg-sage-pill dark:bg-[#1a1b21] border border-sage/40 shadow-[0_4px_14px_-10px_rgba(26,26,23,0.25)]",children:[e.jsxs("span",{className:"flex-1 min-w-0 flex items-center gap-1.5 text-[13px] text-sage-deep dark:text-white/85 whitespace-nowrap",children:[e.jsx("span",{className:"flex-none",children:a?`Ordre modifié · ${R} déplacement${R>1?"s":""} ·`:`Order changed · ${R} move${R===1?"":"s"} ·`}),e.jsx("span",{className:"flex-none font-mono text-[9.5px] uppercase tracking-[0.1em] text-sage-deep/70 dark:text-white/50",children:a?"principale":"main"}),e.jsx("span",{className:"truncate min-w-0",children:W(((ge=v[0])==null?void 0:ge.src)||"")})]}),e.jsxs("span",{className:"flex-none inline-flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{A(r),f(0)},disabled:b,className:"h-9 px-3.5 rounded-full border border-ink/[0.16] dark:border-white/20 font-mono text-[9.5px] uppercase tracking-[0.1em] text-ink/70 hover:border-sage hover:text-sage-deep dark:text-white/70 transition-colors disabled:opacity-50",children:a?"Annuler":"Reset"}),e.jsxs("button",{type:"button",onClick:_e,disabled:b,className:"h-9 inline-flex items-center gap-1.5 px-4 roun
6ded-full bg-sage hover:bg-sage-deep text-card font-mono text-[9.5px] uppercase tracking-[0.1em] transition-colors disabled:opacity-60 whitespace-nowrap",children:[b?a?"Envoiâ¦":"Pushingâ¦":a?"Envoyer":"Push new order",!b&&e.jsx(be,{className:"w-3 h-3",strokeWidth:2.2})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("h1",{className:"font-serif text-[26px] sm:text-[30px] lg:text-[38px] leading-[1.02] tracking-[-0.02em] text-ink dark:text-white",children:r.title||(a?"Sans titre":"Untitled")}),le&&e.jsx("div",{className:"font-mono text-[10px] sm:text-[10.5px] uppercase tracking-[0.1em] text-ink/45 dark:text-white/45",children:le}),e.jsxs("div",{className:"sm:hidden flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-[13px] text-ink/70 dark:text-white/70 truncate",children:M}),U&&e.jsxs("a",{href:U,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-[0.12em] text-sage-deep dark:text-sage whitespace-nowrap",children:[a?`Voir dans ${j[h]}`:`View in ${j[h]}`,e.jsx(ke,{className:"w-3 h-3",strokeWidth:2})]})]})]}),e.jsxs("div",{className:"grid gap-6 lg:gap-10 lg:grid-cols-[minmax(0,1.25fr)_minmax(320px,400px)] items-start",children:[e.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[e.jsxs("div",{className:"relative aspect-square sm:aspect-[16/10] rounded-[8px] bg-sidebar border border-ink/[0.09] dark:bg-white/5 dark:border-white/10 overflow-hidden",children:[l?e.jsx("div",{className:"absolute inset-2.5 sm:inset-3.5 rounded-[4px] bg-white dark:bg-white/[0.06] overflow-hidden",children:e.jsx("img",{src:l.src,alt:l.alt||r.title||"",className:"absolute inset-0 w-full h-full object-contain p-4"},l.src)}):e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-ink/30 dark:text-white/30",children:[e.jsx(qe,{className:"w-10 h-10 mb-2",strokeWidth:1.3}),e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.1em]",children:p("productDetail.noImage")})]}),i>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>f(t=>(t-1+i)%i),"aria-label":a?"Image précédente":"Previous image",className:`${xe} left-3.5`,children:e.jsx(Qe,{className:"w-4 h-4",strokeWidth:2})}),e.jsx("button",{type:"button",onClick:()=>f(t=>(t+1)%i),"aria-label":a?"Image suivante":"Next image",className:`${xe} right-3.5`,children:e.jsx(Ke,{className:"w-4 h-4",strokeWidth:2})})]}),i>0&&e.jsxs("div",{className:"absolute top-3.5 left-3.5 inline-flex items-center gap-2",children:[e.jsxs("span",{className:"font-mono text-[9.5px] tracking-[0.12em] px-[9px] py-[5px] rounded-[5px] bg-card/90 text-ink/60 dark:bg-black/60 dark:text-white/70",children:[Math.min(x,i-1)+1," / ",i]}),x===0&&e.jsx("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.12em] px-[9px] py-[5px] rounded-[5px] bg-ink/70 text-card",children:a?"Photo principale":"Main photo"})]})]}),i>1&&e.jsx("div",{className:"flex items-center gap-[9px] flex-wrap",children:v.map((t,s)=>e.jsxs("button",{type:"button",onClick:()=>f(s),"aria-label":`Image ${s+1}`,className:`relative w-[66px] h-[66px] rounded-[6px] overflow-hidden bg-white dark:bg-white/5 transition-opacity ${s===x?"ring-2 ring-sage opacity-100":"ring-1 ring-ink/[0.12] dark:ring-white/10 opacity-[0.62] hover:opacity-100"}`,children:[e.jsx("img",{src:t.src,alt:"",className:"absolute inset-0 w-full h-full object-cover",loading:"lazy",decoding:"async"}),e.jsx("span",{className:"absolute bottom-[3px] right-1 px-[3px] rounded-[3px] bg-card/85 font-mono text-[9px] text-ink/55",children:s+1}),!t.alt&&e.jsx("span",{"aria-hidden":!0,title:a?"Texte alternatif manquant":"Alt text missing",className:"absolute top-1 left-[5px] w-1.5 h-1.5 rounded-full bg-danger"})]},t.src+s))}),l&&e.jsx(y,{title:a?"Cette image":"This image",aside:e.jsx(K,{children:a?"Retouche · bientôt":"AI edit · soon"}),className:"gap-3.5",children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx(c,{py:"py-[11px]",label:a?"Fichier":"File",value:W(l.src)||"â",top:!0}),e.jsx(c,{py:"py-[11px]",label:a?"Texte alt":"Alt text",value:l.alt||(a?"Manquant â rien pour les moteurs de recherche ni les lecteurs dâécran":"Missing â nothing for search engines or screen readers"),tone:l.alt?void 0:"text-danger",top:!0}),P.dims&&e.jsx(c,{py:"py-[11px]",label:"Dimensions",value:l.width&&l.height?`${l.width} à ${l.height} px`:"â"}),e.jsx(c,{py:"py-[11px]",label:"Position",value:x===0?a?"Case 1 · photo principale":"Slot 1 · main photo":a?`Case ${x+1}`:`Slot ${x+1}`}),e.jsx(c,{py:"py-[11px]",label:a?"Utilisée dans":"Used in",value:N?a?`${N.count} génération${N.count>1?"s":""} · dernière ${E(N.last)}
6`:`${N.count} generation${N.count>1?"s":""} · last ${E(N.last)}`:a?"Aucune génération pour lâinstant":"No generation yet"})]})}),i>0&&e.jsxs(y,{title:`${a?"Toutes les images":"All images"} · ${i}${i>1&&V?a?" · Réordonner avec â²â¼":" · Reorder with â²â¼":""}`,aside:e.jsx("span",{className:`text-[12.5px] ${z===0?"text-sage-deep dark:text-sage":"text-danger"}`,children:z===0?a?"Toutes les images ont un texte alt":"All images have alt text":a?`${z} sur ${i} sans texte alt`:`${z} of ${i} missing alt text`}),className:"gap-0 [&>div:first-child]:pb-3",children:[v.map((t,s)=>e.jsxs("div",{className:`flex items-center gap-3 px-2 py-[9px] rounded-[8px] border-t border-ink/[0.07] dark:border-white/[0.08] transition-colors ${s===x?"bg-sage-pill dark:bg-white/10":"hover:bg-ink/[0.04] dark:hover:bg-white/5"}`,children:[i>1&&V&&e.jsxs("div",{className:"flex flex-col gap-[3px] flex-none",children:[e.jsx("button",{type:"button",onClick:()=>H(s,s-1),disabled:b||s===0,"aria-label":a?"Monter":"Move up",className:pe(b||s===0),children:e.jsx(Ye,{className:"w-3 h-3",strokeWidth:2.2})}),e.jsx("button",{type:"button",onClick:()=>H(s,s+1),disabled:b||s===i-1,"aria-label":a?"Descendre":"Move down",className:pe(b||s===i-1),children:e.jsx(Je,{className:"w-3 h-3",strokeWidth:2.2})})]}),e.jsx("button",{type:"button",onClick:()=>f(s),className:`w-[38px] h-[38px] rounded-[4px] flex-none overflow-hidden bg-white dark:bg-white/10 ${s===x?"ring-2 ring-sage":"ring-1 ring-ink/[0.12] dark:ring-white/10"}`,children:e.jsx("img",{src:t.src,alt:"",className:"w-full h-full object-cover",loading:"lazy",decoding:"async"})}),e.jsxs("button",{type:"button",onClick:()=>f(s),className:"flex flex-col gap-[3px] min-w-0 flex-1 text-left",children:[e.jsx("span",{className:"font-mono text-[11.5px] text-ink/85 dark:text-white/85 truncate",children:W(t.src)||"â"}),e.jsx("span",{className:`text-[12px] truncate ${t.alt?"text-ink/55 dark:text-white/55":"text-danger"}`,children:t.alt||(a?"Sans texte alt":"No alt text")})]}),P.dims&&e.jsx("span",{className:"font-mono text-[10px] text-ink/40 dark:text-white/40 flex-none",children:t.width&&t.height?`${t.width}Ã${t.height}`:"â"}),e.jsx("span",{className:`font-mono text-[9.5px] uppercase tracking-[0.1em] w-[58px] text-right flex-none ${s===0?"text-sage-deep dark:text-sage":"text-ink/35 dark:text-white/35"}`,children:Me(s)})]},String(t.id)+s)),ae&&e.jsx("p",{className:"mt-3 text-[12.5px] text-ink/50 dark:text-white/50",children:a?"Cette boutique ne permet pas de réordonner ses photos depuis ici.":"This store does not allow reordering its photos from here."})]})]}),e.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[e.jsxs(y,{title:a?"Sélection pour la génération":"Selected for generation",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-[6px] flex-none overflow-hidden bg-white dark:bg-white/10 ring-2 ring-sage",children:l&&e.jsx("img",{src:l.src,alt:"",className:"w-full h-full object-contain p-1"})}),e.jsx("div",{className:"text-[13px] leading-[1.4] text-ink/75 dark:text-white/75",children:i===0?a?"Cette fiche nâa pas encore de photo.":"This product has no photo yet.":`${Re(l)} â ${a?`photo ${x+1} sur ${i}${x===0?", la principale.":"."}`:`shot ${x+1} of ${i}${x===0?", main photo.":"."}`}`})]}),e.jsxs("button",{type:"button",onClick:()=>Se(l==null?void 0:l.src),disabled:!l,className:"flex items-center justify-center gap-2.5 h-[52px] px-5 rounded-full bg-sage hover:bg-sage-deep text-card font-mono text-[11px] uppercase tracking-[0.12em] transition-colors disabled:opacity-50",children:[e.jsx("span",{children:a?"Générer avec cette image":"Generate with this image"}),e.jsx(be,{className:"w-3.5 h-3.5",strokeWidth:2.2})]}),x!==0&&i>1&&V&&e.jsx("button",{type:"button",onClick:()=>H(x,0),className:"flex items-center justify-center h-11 px-5 rounded-full border border-ink/[0.14] dark:border-white/20 font-mono text-[10.5px] uppercase tracking-[0.12em] text-ink/70 hover:border-sage hover:text-sage-deep dark:text-white/70 dark:hover:text-white transition-colors",children:a?"En faire la photo principale":"Make this the main photo"})]}),e.jsx(y,{title:"Commerce",className:"gap-0",children:e.jsxs("div",{className:"flex flex-col pt-1.5",children:[e.jsx(c,{size:"text-[13.5px]",label:p("productDetail.price"),value:we(r.currency,r.price),tone:"text-ink dark:text-white"}),P.compareAt&&e.jsx(c,{size:"text-[13.5px]",label:a?"Prix barré":"Compare at",value:we(r.currency,C.compare_at_price),tone:"text-ink/60 dark:text-white/60"}),e.jsx(c,{size:"text-[13.5px]",label:p("productDetail.stock"),value:O>0?p("productDetail.inStock",{count:O}):O===0?p("productDetail.outOfStock"):"â",tone:O===0?"text-danger":"text-ink dark:text-white"}),e.jsx(c,{size:"text-[13.5px]",label:p("productDetail.sku"),value:r.sku||C.sku||null,tone:"text-ink dark:text-white"}),P.barcode&&e.jsx(c,{size:"text-[13.5px]",label:a?"Code-barres":"Barcode",value:C.barcode||null,tone:"text-ink/75 dark:text-white/75"}),e.jsx(c,{size:"text-[13.5px]",label:a?"Variantes":"Variants",value:Ae,tone:"text-ink dark:text-white"}),P.vendor&&e.jsx(c,{size:"text-[13.5px]",label:a?"Marque":"Vendor",value:r.vendor||null,tone:"text-ink dark:text-white"}),e.jsx(c,{size:"text-[13.5px]",label:"Type",value:r.product_type||null,tone:"text-ink dark:text-white"})]})}),e.jsx(y,{title:"Description",aside:e.jsx(K,{children:a?"Réécriture · bientôt":"AI rewrite · soon"}),children:S?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[13.5px] leading-[1.6] text-ink/70 dark:text-white/70",children:S}),e.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.08em] text-ink/40 dark:text-white/40",children:[a?`${S.length} caractères · ${oe} mots`:`${S.length} characters · ${oe} words`,Le?a?" · importée en HTML":" · imported as HTML":""]})]}):e.jsx("p",{className:"text-[13.5px] text-ink/50 dark:text-white/50",children:a?"Pas de description sur la fiche.":"No description on the product page."})}),e.jsx(y,{title:"SEO",aside:e.jsx(K,{children:a?"Optimisation · bientôt":"AI optimise · soon"}),className:"gap-0",children:De.map(t=>e.jsxs("div",{className:"flex flex-col gap-[5px] pt-2.5 pb-1 border-t border-ink/[0.07] dark:border-white/[0.08]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.1em] text-ink/45 dark:text-white/45",children:t.label}),e.jsx("span",{className:`font-mono text-[10px] ${t.max&&t.value&&t.value.length>t.max?"text-danger":"text-ink/40 dark:text-white/40"}`,children:t.max?`${t.value?t.value.length:0}/${t.max}`:"HANDLE"})]}),e.jsx("div",{className:`text-[13px] leading-[1.5] break-words ${t.value?"text-ink/80 dark:text-white/80":"text-ink/40 dark:text-white/40"}`,children:t.value||(a?"Non renseigné":"Not set")})]},t.label))}),e.jsxs(y,{title:"Organisation",children:[ne.length>0?e.jsx("div",{className:"flex gap-[7px] flex-wrap",children:ne.map(t=>e.jsx("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.1em] px-2.5 py-[5px] rounded-full bg-ink/[0.06] text-ink/55 dark:bg-white/10 dark:text-white/60",children:t},t))}):e.jsx("p",{className:"text-[12.5px] text-ink/45 dark:text-white/45",children:a?"Aucun tag sur la fiche.":"No tags on the product page."}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx(c,{py:"py-[9px]",label:a?"Boutique":"Store",value:e.jsx("span",{className:"font-mono text-[11px] text-ink/70 dark:text-white/70 break-all",children:((fe=r.store)==null?void 0:fe.shop_domain)||M})}),e.jsx(c,{py:"py-[9px]",label:a?"ID produit":"Product ID",value:e.jsx("span",{className:"font-mono text-[11px] text-ink/70 dark:text-white/70 break-all",children:r.platform_product_id})}),e.jsx(c,{py:"py-[9px]",label:a?"Créé":"Created",value:e.jsx("span",{className:"font-mono text-[11px] text-ink/70 dark:text-white/70",children:E(r.platform_created_at)||(a?"Non fourni":"Not provided")})}),e.jsx(c,{py:"py-[9px]",label:a?"Dernière synchro":"Last synced",value:e.jsx("span",{className:"font-mono text-[11px] text-ink/70 dark:text-white/70",children:E(r.synced_at,!0)||"â"})})]})]})]})]})]}),e.jsx(Ve,{isOpen:ye,onClose:()=>B(!1),trigger:"product_page_reorder"})]})};export{ut as default};
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.