PageSourceSearch

https://elistingo.com/assets/intermediate-step-CHg20uMG.js

js elistingo.com collected 2026-09-24 14:42:54 UTC 41,878 bytes, 1 lines download raw bytes

1import{c as _s,r as p,j as e,l as O,aD as B,aE as te,aF as lt,aG as ct,v as ps,q as le,L as gs,B as ce,I as vs,aH as Ns,S as dt,J as ys,K as ws,M as ks,N as Ms,Q as Cs,U as Is,V as Ss,d as ut}from"./index-BLTtCV_q.js";import{L as mt,I as xt}from"./label-BmvL6Xoz.js";import{S as qe,a as Ye,b as Je,c as Xe,d as We,T as pt,e as gt,f as ft,g as ht}from"./tooltip-bARzJRTs.js";import{S as bt,I as jt}from"./switch-DZNvn3Ve.js";import{P as zs,a as Os,b as Ps}from"./popover-CMXs_8br.js";import{P as _t,u as vt,a as Ze,b as pe,c as Nt,d as yt,i as ne,e as ue,T as wt}from"./_app-DrocH5NR.js";import{u as kt}from"./use-plan-Dp6E9DIT.js";import{C as Mt}from"./chevron-down-BS-0xHzm.js";import{q as me,C as $s,X as es}from"./starfield-bg-DZIxp1Km.js";import{C as Ct}from"./chevron-left-OcPyV5jh.js";import{h as It,V as St,e as zt,b as Ot,r as Pt,n as $t,a as fs,d as hs,p as Et,c as Dt,f as Ft,s as Rt}from"./variation-order-BGJDDUbX.js";import{C as Es}from"./confirm-button-DRIZFjeT.js";import{G as Ds}from"./grip-vertical-DSQ_RlxY.js";import{M as Fs}from"./minus-DEdPF2KY.js";import"./dialog-CRfIDFpB.js";import"./loader-circle-DeGl_TPx.js";import"./circle-check-1Cc6J4G2.js";const Vt=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],Qe=_s("images",Vt);const Tt=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],At=_s("ruler",Tt);function bs({value:o,groups:i,onChange:x,disabled:u,placeholder:g,backLabel:N="Retour"}){const[_,b]=p.useState(!1),[M,S]=p.useState(null),D=m=>m.minCost??m.sortCost,l=m=>Math.min(...m.models.map(D)),P=[...i].map(m=>({...m,models:[...m.models].sort((k,R)=>R.sortCost-k.sortCost)})).sort((m,k)=>l(k)-l(m)),c=P.flatMap(m=>m.models).find(m=>m.id===o);p.useEffect(()=>{if(!_)return;const m=P.find(k=>k.models.some(R=>R.id===o));S(m?.provider??null)},[_,o]);const j=m=>{const k=l(m),R=Math.max(...m.models.map(Y=>Y.sortCost));return k===R?`${k.toFixed(2)} cr`:`${k.toFixed(2)} cr - ${R.toFixed(2)} cr`},C=M?P.find(m=>m.provider===M):null;return e.jsxs(zs,{open:_,onOpenChange:m=>!u&&b(m),children:[e.jsxs(Os,{disabled:u,className:O("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm","ring-offset-background focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50"),children:[e.jsx("span",{className:"truncate text-left",children:c?`${c.name} (${c.cost})`:g??"—"}),e.jsx(Mt,{className:"size-4 shrink-0 opacity-50"})]}),e.jsx(Ps,{align:"start",className:"w-[--radix-popover-trigger-width] min-w-[16rem] p-1",children:C?e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("button",{type:"button",onClick:()=>S(null),className:"flex w-full items-center gap-1.5 rounded-sm px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-accent",children:[e.jsx(Ct,{className:"size-3.5"})," ",N]}),e.jsx("div",{className:"px-2 pb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:C.provider}),C.models.map(m=>e.jsxs("button",{type:"button",disabled:m.locked,onClick:()=>{m.locked||(x(m.id),b(!1))},className:O("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm hover:bg-accent",m.locked&&"cursor-not-allowed opacity-50 hover:bg-transparent"),children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsxs("span",{className:"truncate",children:[m.name," ",e.jsxs("span",{className:"text-muted-foreground",children:["(",m.cost,")"]})]}),m.locked&&e.jsx(_t,{asSpan:!0})]}),m.id===o&&e.jsx($s,{className:"size-4 shrink-0"})]},m.id))]}):e.jsx("div",{className:"space-y-0.5",children:P.map(m=>e.jsxs("button",{type:"button",onClick:()=>S(m.provider),className:"flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm hover:bg-accent",children:[e.jsxs("span",{className:"truncate",children:[m.provider," ",e.jsxs("span",{className:"text-muted-foreground",children:["(",j(m),")"]})]}),e.jsx(me,{className:"size-4 shrink-0 opacity-50"})]},m.provider))})})]})}const Gt={ali:{backgroundColor:"#E52F20"},etsy:{backgroundColor:"#F56400"}};function G(o){if(!o)return"";const i=String(o).trim().replace(/^\/\//,"https://").replace("https://ae01.alicdn.com/kf/","https://ae-pic-a1.aliexpress-media.com/kf/").replace(/\?.*$/,"").replace(/\.(jpg|jpeg|png|webp|avif)_[^/]*$/i,".$1"),x=/\/([^/?#]+?)(?:_\d+x\d+[^/]*)?\.(jpe?g|png|webp|gif|avif)$/i.exec(i);return(x?`${x[1]}.${x[2]}`:i).toLowerCase()}const ss=["face","profil droit","profil gauche","dos","haut","bas","zoom","dézoom"],Ie=(o,i)=>o(i==="studio"?"is_ambiance_studio":"is_ambiance_lifestyle"),Se=(o,i)=>o(i==="unworn"?"is_wear_unworn":"is_wear_worn");function xe(o,i){return`${o}_${i}`}
1function Lt(o,i,x){const u=[],g=new Set,N=(_,b)=>{const M=G(_);!_||g.has(M)||(g.add(M),u.push({url:_,source:b}))};return(o?.images||[]).forEach(_=>N(_,"ali")),(i?.images||[]).forEach(_=>N(_,"etsy")),u.length===0&&x?.images&&x.images.forEach(_=>N(_,"ali")),u}function Bt(o=[]){return o.map(i=>({...i,values:[...i.values??[]],images:i.images?[...i.images]:void 0,valueIds:i.valueIds?[...i.valueIds]:void 0}))}function Kt(o=[]){return o.map(i=>({...i,variations:(i.variations??[]).map(x=>({...x}))}))}function Ut(o){const i=Rt(o.values??[]);if(!i)return o;const x=o;return{...o,values:i.map(u=>o.values[u]),images:o.images?i.map(u=>o.images[u]??null):void 0,...x.optionIds?{optionIds:i.map(u=>x.optionIds[u])}:{},...x.valueIds?{valueIds:i.map(u=>x.valueIds[u])}:{}}}function Ht(o,i){const x=!!i?.editedVariations,u=Bt(i?.editedVariations??o.variations??[]).filter(b=>(b.values?.filter(Boolean).length??0)>=1).map(b=>x?b:Ut(b)),g=zt(u),N=new Set(g.map(b=>b.name)),_=Ot(g,Pt(g,Kt(i?.editedVariationPrices??o.variationPrices??[])));return{variations:g,prices:_.filter(b=>b.variations?.every(M=>N.has(M.name)))}}function qt(o,i){if(i?.images)return i.images;const x={};return o.forEach((u,g)=>{x[g]={selected:!0,shots:{}}}),x}function Yt(o,i,x=350){p.useEffect(()=>{const u=window.setTimeout(o,x);return()=>window.clearTimeout(u)},i)}function kn({product:o,productAli:i,productEtsy:x,locked:u,initialChoices:g,onDraftChange:N,onGenerate:_,onShopChange:b,submitLabel:M}){const{items:S}=vt(),{items:D}=Ze(),{t:l}=pe(),{isPro:P}=kt(),{prefs:c,update:j}=Nt(),C=s=>s==="pro"&&!P,m=p.useMemo(()=>Lt(i,x,o),[i,x,o]),[k,R]=p.useState(g?.shop??""),Y=ct,ge=c.imageModel&&c.imageModel in B?c.imageModel:void 0,fe=c.textModel&&c.textModel in te?c.textModel:void 0,[K,y]=p.useState(g?.textModel??fe??lt),[z,A]=p.useState(g?.imageModel??ge??Y),Q=s=>{const t=B[s].resolutions;return t[t.length-1]??t[0]},ts=g?.imageModel??ge??Y,As=c.resolution&&B[ts]?.resolutions?.includes(c.resolution)?c.resolution:void 0,[J,he]=p.useState(g?.resolution??As??Q(ts)),[V,Gs]=p.useState(g?.sizeGuide??!1),[ae,Ls]=p.useState(g?.sizeGuideRefIdx??0),[q,Z]=p.useState("all"),[tn,nn]=p.useState(()=>new Set),[I,Bs]=p.useState(m),[T,$e]=p.useState(()=>qt(m,g)),ns=p.useMemo(()=>Ht(o,g),[o,g]),[$,U]=p.useState(ns.variations),[Ee,X]=p.useState(ns.prices),[rn,an]=p.useState({past:[],future:[]}),Ks=p.useRef(!1),[Us,Hs]=p.useState(null),[be,De]=p.useState(null),Fe=p.useRef(!1),E=()=>{Fe.current=!0};p.useEffect(()=>{if(Ks.current=!0,S.length===1&&!k){const s=S[0].id;R(s),b?.(s)}},[S]);const rs=p.useRef(!1);p.useEffect(()=>{if(!rs.current&&!(!c||Object.keys(c).length===0))if(rs.current=!0,!g?.textModel&&c.textModel&&c.textModel in te&&y(c.textModel),!g?.imageModel&&c.imageModel&&c.imageModel in B){const s=c.imageModel;A(s);const t=B[s].resolutions,n=c.resolution&&t.includes(c.resolution)?c.resolution:Q(s);he(n)}else!g?.resolution&&c.resolution&&B[z].resolutions.includes(c.resolution)&&he(c.resolution)},[c]);function qs(s){E(),A(s);const t=Q(s);he(t),j({imageModel:s,resolution:t})}function Ys(s){E(),y(s),j({textModel:s})}function Js(s){E(),he(s),j({resolution:s})}function Xs(s){E(),Gs(s)}const oe=p.useMemo(()=>Object.values(T).reduce((s,t)=>s+Object.values(t.shots).reduce((n,r)=>n+(r||0),0),0),[T]),Ws=20,as=(s,t)=>{const n=T[s]??{shots:{}},r=Object.values(n.shots).reduce((v,w)=>v+(w||0),0),a=Object.values(t).reduce((v,w)=>v+(w||0),0),d=Ws-(V?1:0)-(oe-r);if(a<=d)return t;const f={...t};let h=a-Math.max(0,d);for(const v of Object.keys(f)){const w=n.shots[v]??0,F=f[v]??0;if(F>w&&h>0){const ke=Math.min(h,F-w);f[v]=F-ke,h-=ke,f[v]<=0&&delete f[v]}}return f},je=p.useMemo(()=>{const s=JSON.stringify(i??{}),t=JSON.stringify(x??{});return i||x?s.length+t.length:JSON.stringify(o).length},[i,x,o]),L=P?"pro":"basic",ee=p.useMemo(()=>ps(K,je,L),[K,je,L]),se=p.useMemo(()=>ee+oe*le(z,J,L)+(V?le(z,J,L):0),[ee,oe,z,J,V,L]),Qs=p.useMemo(()=>{const s=new Map;for(const[t,n]of Object.entries(te)){const r=ps(t,je,L),a=s.get(n.provider)??[];a.push({id:t,name:n.name,cost:`${r.toFixed(2)} cr`,sortCost:r,locked:C(n.tier)}),s.set(n.provider,a)}return[...s.entries()].map(([t,n])=>({provider:t,models:n}))},[je,L,P]),Zs=p.useMemo(()=>{const s=new Map;for(const[t,n]of Object.entries(B)){const r=n.resolutions.map(h=>le(t,h,L)),a=Math.min(...r),d=Math.max(...r),f=s.get(n.provider)??[];f.push({id:t,name:n.name,cost:a===d?`${a.toFixed(2)} cr`:`${a.toFixed(2)} cr - ${d.toFixed(2)} cr`,sortCost:d,minCost:a,locked:C(n.tier)}),s.set(n.provider,f)}return[...s.entries()].map(([t,n])=>({provider:t,models:n}))},[L,P]),W={ali:I.filter(s=>s.source==="ali").length,etsy:I.filter(s=>s.source==="etsy").length},_e=p.useMemo(()=>I.map((s,t)=>({p:s,i:t})).filter(({p:s})=>q==="all"||s.source===q),[I,q]),Re=p.useMemo(()=>yt(T),[T]),Ve=()=>{const s=new Set;Object.values(T).forEach(n=>{Object.keys(n.shots??{}
1).forEach(r=>{const[a,d]=r.split(":");a==="custom"&&d&&s.add(d)})});const t={};return D.forEach(n=>{s.has(n.id)&&(t[n.id]=n.body)}),{shop:k,textModel:K,imageModel:z,resolution:J,sizeGuide:V,sizeGuideRefIdx:ae,images:T,totalCredits:se,pool:I.map(n=>n.url),editedVariations:$,editedVariationPrices:Ee,customPrompts:Object.keys(t).length?t:void 0}},Te=()=>({...o,images:I.map(s=>s.url),image:I[0]?.url??o.image,variations:$,variationPrices:Ee});Yt(()=>{u||Fe.current&&(Fe.current=!1,N?.(Ve(),Te()))},[k,K,z,J,V,ae,T,$,Ee,I,u]),p.useEffect(()=>{if(Re.length===0)return;const s=new Map;Re.forEach(n=>{s.has(n.refIdx)||s.set(n.refIdx,n.key)});const t=new Map;I.forEach((n,r)=>{const a=s.get(r);a&&t.set(G(n.url),a)}),U(n=>{let r=!1;const a=n.map(d=>{if(!d.images?.length)return d;const f=d.images.map(h=>{if(!h||ne(h))return h;const v=t.get(G(h));return v&&(r=!0),v??h});return r?{...d,images:f}:d});return r?a:n}),X(n=>{let r=!1;const a=n.map(d=>{if(!d.image||ne(d.image))return d;const f=t.get(G(d.image));return f?(r=!0,{...d,image:f}):d});return r?a:n})},[Re,I]);const et=(s,t)=>{if(s===t||t<0||t>=I.length)return;E();const n=[...I],[r]=n.splice(s,1);n.splice(t,0,r);const a=new Map(I.map((f,h)=>[f.url,T[h]??{selected:!0,shots:{}}])),d={};n.forEach((f,h)=>{d[h]=a.get(f.url)??{selected:!0,shots:{}}}),Bs(n),$e(d)},st=(s,t)=>{U(n=>!n[s]||n[s].name===t?n:(E(),X(r=>Ft(r,n[s],t)),n.map((r,a)=>a===s?{...r,name:t}:r)))},tt=s=>{E(),U(t=>{const n=t[s]?.name;return n?(X(r=>hs(r,n)),t.filter((r,a)=>a!==s)):t})},os=(s,t,n)=>{U(r=>{const a=r[s];return!a||a.values[t]===n?r:(E(),X(d=>Dt(d,a,t,n)),r.map((d,f)=>f===s?{...d,values:d.values.map((h,v)=>v===t?n:h)}:d))})},Ae=(s,t)=>{E(),U(n=>{const r=n[s];return r?r.values.length<=1?(X(a=>hs(a,r.name)),n.filter((a,d)=>d!==s)):(X(a=>Et(a,r,t)),n.map((a,d)=>d===s?{...a,values:a.values.filter((f,h)=>h!==t),images:a.images?.filter((f,h)=>h!==t),optionIds:a.optionIds?.filter((f,h)=>h!==t)}:a)):n})},nt=(s,t,n)=>{t!==n&&U(r=>{const a=r[s];if(!a||t<0||t>=a.values.length||n<0||n>=a.values.length)return r;const d=[...a.values],[f]=d.splice(t,1);d.splice(n,0,f);const h=a.images?[...a.images]:void 0;if(h){const[w]=h.splice(t,1);h.splice(n,0,w)}const v=a.optionIds?[...a.optionIds]:void 0;if(v){const[w]=v.splice(t,1);v.splice(n,0,w)}return E(),r.map((w,F)=>F===s?{...w,values:d,images:h,optionIds:v}:w)})},is=s=>{E(),U(t=>{const n=t[s];if(!n)return t;const r=`Option ${n.values.length+1}`,a=fs(),d=t.filter((h,v)=>v!==s&&(h.values?.length??0)>1),f=d.length===0?[[]]:d.reduce((h,v)=>h.flatMap(w=>v.values.map(F=>[...w,{name:v.name,value:F}])),[[]]);return X(h=>[...h,...f.map(v=>({variations:[{name:n.name,value:r,varId:n.id,valueId:a},...v],price:0,image:null}))]),t.map((h,v)=>v===s?{...h,values:[...h.values,r],images:h.images?[...h.images,null]:[...new Array(h.values.length).fill(null),null],optionIds:[...h.optionIds??[],a]}:h)})},ls=()=>{E(),U(s=>{const t=`Variation ${s.length+1}`,n=["Option 1","Option 2"],r=$t(),a=n.map(()=>fs()),d=s.filter(h=>(h.values?.length??0)>1),f=d.length===0?[[]]:d.reduce((h,v)=>h.flatMap(w=>v.values.map(F=>[...w,{name:v.name,value:F}])),[[]]);return X(h=>[...h,...n.flatMap(v=>f.map(w=>({variations:[{name:t,value:v,varId:r,valueId:a[n.indexOf(v)]},...w],price:0,image:null})))]),[...s,{name:t,values:n,images:[null,null],id:r,optionIds:a}]})},cs=(s,t,n)=>{if(n&&$.some((a,d)=>d!==s&&(a.images??[]).some(Boolean))){const a=$.find((d,f)=>f!==s&&(d.images??[]).some(Boolean));ut.error(`Les images sont déjà associées à « ${a?.name} ». Une seule variation peut porter des images.`);return}E(),U(r=>r.map((a,d)=>{if(d!==s)return a;const f=a.images?[...a.images]:a.values.map(()=>null);return f[t]=n,{...a,images:f}}))},ds=p.useMemo(()=>It(o?.variationPrices),[o]),rt=s=>{const t=$[s],n=!!t&&(t.images??[]).some(Boolean),r=l(n?"is_describe_imgs_basculent":"is_describe_no_img");return ds?`${r}${l("is_prices_other_intact")}`:r},Ge=(s,t,n)=>{const r=$[s];if(!r)return"";const a=!!r.images?.[t],d=r.values.length<=1,f=l(a?"is_describe_img_basculer":"is_describe_no_img"),h=d?l("is_dissolve_part").replace("{name}",r.name):"",v=ds?l("is_prices_other_intact"):"";return`${f}${h}${v}`},ie=S.length===0,Le=oe===0&&!V,H=p.useMemo(()=>{const s=$.map(n=>n.name),t=s.find((n,r)=>s.indexOf(n)!==r);if(t)return{kind:"variation",label:t,group:"",count:s.filter(n=>n===t).length};for(const n of $){const r=n.values??[],a=r.find((d,f)=>r.indexOf(d)!==f);if(a)return{kind:"option",label:a,group:n.name,count:r.filter(d=>d===a).length}}return null},[$]),ve=p.useMemo(()=>{const s=new Set,t=new Set;$.filter(r=>(r.values?.length??0)>
1=1).forEach(r=>(r.images??[]).slice(0,r.values?.length??0).forEach(a=>{if(a)if(ne(a)){const d=Number(a.slice(7).split("/")[0]);Number.isFinite(d)&&t.add(d)}else s.add(G(a))}));const n=[];return I.forEach((r,a)=>{(s.has(G(r.url))||t.has(a))&&n.push(a)}),n},[$,I]),Ne=p.useMemo(()=>new Set(ve),[ve]),at=p.useMemo(()=>_e.filter(({i:s})=>Ne.has(s)),[_e,Ne]),Be=p.useMemo(()=>_e.filter(({i:s})=>!Ne.has(s)),[_e,Ne]),Ke=p.useMemo(()=>ve.filter(s=>{const t=T[s];return t?Object.values(t.shots).reduce((r,a)=>r+(a||0),0)===0:!0}),[ve,T]),us=Ke.length>0,ye=!ie&&!!k&&!Le&&!us&&!H;V&&I[ae]?.url;const we=oe+(V?1:0),ms=I.length,Ue=p.useMemo(()=>{const s={ali:0,etsy:0};return I.map(t=>(s[t.source]+=1,s[t.source]))},[I]),[ot,He]=p.useState(null),xs=V?I[ot??ae]?.url:void 0;return e.jsxs("div",{className:"mx-auto max-w-6xl space-y-4 px-4 py-4",children:[e.jsx("header",{className:"flex flex-wrap items-center justify-between gap-3",children:e.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:l("is_configuration")})}),e.jsx(Wt,{ali:i,etsy:x}),e.jsx("section",{className:"rounded-lg border bg-card p-4",children:e.jsxs("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-4",children:[e.jsx(Ce,{label:l("is_shop"),children:S.length===0?e.jsx("div",{className:"rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground",children:l("no_shop_registered")}):e.jsxs(qe,{value:k,onValueChange:s=>{E(),R(s),b?.(s)},children:[e.jsx(Ye,{children:e.jsx(Je,{placeholder:l("is_choose_shop")})}),e.jsx(Xe,{children:S.map(s=>e.jsxs(We,{value:s.id,children:[s.name,s.useAdspower?" · AdsPower":""]},s.id))})]})}),e.jsxs(Ce,{label:l("is_text"),children:[e.jsx(bs,{value:K,disabled:u,backLabel:l("is_back_models"),groups:Qs,onChange:s=>{const t=te[s];!t||C(t.tier)||Ys(s)}}),C(te[K].tier)&&e.jsxs("p",{className:"mt-1 text-[10px] text-muted-foreground",children:[l("is_pro_model_prefix"),e.jsx(gs,{to:"/pricing",className:"underline",children:l("is_upgrade_pro")})]})]}),e.jsxs(Ce,{label:l("is_image"),children:[e.jsx(bs,{value:z,disabled:u,backLabel:l("is_back_models"),groups:Zs,onChange:s=>{const t=B[s];!t||C(t.tier)||qs(s)}}),C(B[z].tier)&&e.jsxs("p",{className:"mt-1 text-[10px] text-muted-foreground",children:[l("is_pro_model_prefix"),e.jsx(gs,{to:"/pricing",className:"underline",children:l("is_upgrade_pro")})]})]}),e.jsx(Ce,{label:l("is_resolution"),children:e.jsxs(qe,{value:J,onValueChange:Js,disabled:u,children:[e.jsx(Ye,{children:e.jsx(Je,{})}),e.jsx(Xe,{children:B[z].resolutions.map(s=>{const t=le(z,s,L);return e.jsxs(We,{value:s,children:[s," (",t.toFixed(2)," cr)"]},s)})})]})})]})}),$.length===0&&e.jsxs("section",{className:O("rounded-lg border bg-card p-4",u&&"pointer-events-none opacity-60"),children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(Me,{icon:e.jsx(Qe,{className:"size-4"}),title:l("is_main_images")}),e.jsxs(ce,{size:"sm",variant:"outline",className:"h-7 gap-1.5 text-xs",onClick:ls,children:[e.jsx(ue,{className:"size-3.5"})," ",l("is_add_variation")]})]}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:l("is_no_variation_hint")})]}),$.length>0&&e.jsxs("section",{className:O("rounded-lg border bg-card p-4",u&&"pointer-events-none opacity-60"),children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[e.jsx(Me,{icon:e.jsx(Qe,{className:"size-4"}),title:(()=>{const s=$.reduce((t,n)=>{const r=(n.images??[]).some(a=>{if(!a)return!1;if(ne(a))return!0;const d=G(a);return I.some(f=>G(f.url)===d)});return t+(r?n.values?.length??0:0)},0);return`${l("is_main_images")} (${s})`})()}),e.jsxs("div",{className:"flex items-center gap-2",children:[W.ali>0&&W.etsy>0&&e.jsxs("div",{className:"flex items-center gap-1 rounded-full border p-0.5 text-[11px] font-semibold",children:[e.jsxs(re,{active:q==="all",onClick:()=>Z("all"),children:[l("is_all")," (",ms,")"]}),e.jsxs(re,{active:q==="ali",onClick:()=>Z("ali"),children:["AliExpress (",W.ali,")"]}),e.jsxs(re,{active:q==="etsy",onClick:()=>Z("etsy"),children:["Etsy (",W.etsy,")"]})]}),$.length<2&&e.jsxs(ce,{size:"sm",variant:"outline",className:"h-7 gap-1.5 text-xs",onClick:ls,children:[e.jsx(ue,{className:"size-3.5"})," ",l("is_add_variation")]})]})]}),e.jsx("div",{className:"space-y-4",children:$.map((s,t)=>{const n=(s.images??[]).some(r=>{if(!r)return!1;if(ne(r))return!0;const a=G(r);return I.some(d=>G(d.url)===a)});return e.jsxs("div",{draggable:$.length>1,onDragStart:()=>De(t),onDragEnd:()=>De(null),onDragOver:r=>r.preventDefault(),onDrop:r=>{r.preventDefault(),be!=null&&be!==t&&(E(),U(a=>{const d=[...a],[f]=d.splice(be,1);return d.splice(t,0,f),d})),De(null)},className:O("rounded-md border transition",n?"bg-background/40 p-3":"bg-background/20 px-3 py-2",be===t&&"opacity-30 ring-1 ring-brand"),children:[e.jsxs("div",{className:O("flex items-center justify-between gap-2",n?"mb-3":"mb-2"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[$.length>
11&&e.jsx("span",{className:"cursor-grab text-muted-foreground/70 hover:text-foreground",title:l("is_drag_reorder_var"),children:e.jsx(Ds,{className:"size-4"})}),e.jsx("div",{className:O("font-semibold",n?"text-sm":"text-xs"),children:s.name}),!n&&e.jsx("span",{className:"rounded-full px-2 py-0.5 text-[10px] font-medium text-muted-foreground/70",title:l("is_no_render_tip"),children:l("is_no_render")})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(ce,{size:"sm",variant:"ghost",className:"h-7 gap-1 text-xs",onClick:()=>is(t),children:[e.jsx(ue,{className:"size-3.5"})," ",l("is_option")]}),e.jsx(St,{variation:s,onRename:r=>st(t,r),onRemove:()=>tt(t),removeDescription:rt(t),onRenameModality:(r,a)=>os(t,r,a),onRemoveModality:r=>Ae(t,r),modalityRemoveDescription:(r,a)=>Ge(t,r),onAddModality:()=>is(t),onReorderModality:(r,a)=>nt(t,r,a),galleryImages:I.map(r=>r.url),onSetModalityImage:(r,a)=>cs(t,r,a),triggerClassName:"opacity-60"})]})]}),n?e.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:s.values.map((r,a)=>{const d=s.images?.[a]??null;let f=-1;if(d)if(ne(d)){const w=Number(d.slice(7).split("/")[0]);Number.isFinite(w)&&(f=w)}else{const w=G(d);f=I.findIndex(F=>G(F.url)===w)}const h=f>=0?I[f]?.url??null:null,v=f>=0?T[f]??{selected:!0,shots:{}}:{selected:!0,shots:{}};return e.jsx(Zt,{optionName:r,image:h,cfg:v,pool:I,sourceIds:Ue,onRenameOption:w=>os(t,a,w),onRemoveOption:()=>Ae(t,a),removeDescription:Ge(t,a),onSetImage:w=>cs(t,a,w),onChangeShots:w=>{if(f<0)return;E();const F=as(f,w);$e(ke=>({...ke,[f]:{selected:Object.values(F).some(it=>it>0),shots:F}}))}},r+a)})}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.values.map((r,a)=>e.jsxs("div",{className:"flex items-center gap-1 rounded-full border bg-card px-2.5 py-1 text-xs",children:[e.jsx("span",{children:r}),e.jsx(Es,{onConfirm:()=>Ae(t,a),title:l("is_remove_option_q").replace("{val}",r),description:Ge(t,a),className:"text-muted-foreground hover:text-destructive",triggerTitle:l("is_remove_option"),children:e.jsx(es,{className:"size-3"})})]},r+a))})]},s.name+t)})})]}),e.jsxs("section",{className:O("rounded-lg border bg-card p-4",u&&"pointer-events-none opacity-60"),children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[e.jsx(Me,{icon:e.jsx(Qe,{className:"size-4"}),title:`${l("is_supp_images")} (${Be.length})`}),at.length===0&&W.ali>0&&W.etsy>0&&e.jsxs("div",{className:"flex items-center gap-1 rounded-full border p-0.5 text-[11px] font-semibold",children:[e.jsxs(re,{active:q==="all",onClick:()=>Z("all"),children:[l("is_all")," (",ms,")"]}),e.jsxs(re,{active:q==="ali",onClick:()=>Z("ali"),children:["AliExpress (",W.ali,")"]}),e.jsxs(re,{active:q==="etsy",onClick:()=>Z("etsy"),children:["Etsy (",W.etsy,")"]})]})]}),e.jsx(en,{title:"",subtitle:l("is_supp_images_hint"),items:Be,images:T,sourceIds:Ue,dragIdx:Us,setDragIdx:Hs,moveItem:et,setImages:s=>{E(),$e(s)},clampShots:as}),Be.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:l("is_no_supp")})]}),e.jsxs("section",{className:O("rounded-lg border bg-card p-4",u&&"pointer-events-none opacity-60"),children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(Me,{icon:e.jsx(At,{className:"size-4"}),title:l("is_size_guide")}),e.jsx(bt,{checked:V,onCheckedChange:Xs})]}),V&&e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:l("is_size_guide_hint")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[xs&&e.jsx("img",{src:xs,alt:"",className:"size-20 shrink-0 rounded border object-cover"}),e.jsxs(qe,{value:String(ae),onValueChange:s=>{E(),Ls(Number(s))},onOpenChange:s=>{s||He(null)},children:[e.jsx(Ye,{className:"h-9 w-60 text-xs",children:e.jsx(Je,{})}),e.jsx(Xe,{children:I.map((s,t)=>e.jsxs(We,{value:String(t),onMouseEnter:()=>He(t),onFocus:()=>He(t),children:[s.source==="ali"?"ALI":"ETSY"," #",Ue[t]]},s.url+t))})]})]})]})]}),e.jsxs("footer",{className:"sticky bottom-0 -mx-4 flex flex-wrap items-center justify-between gap-3 border-t bg-background/90 px-4 py-3 backdrop-blur",children:[e.jsxs("div",{className:"min-w-0 text-sm text-muted-foreground",children:[l("is_total")," :"," ",e.jsxs("span",{className:"font-semibold text-foreground",children:[se.toFixed(2)," ",l("is_credits")]}),e.jsxs("span",{className:"ml-2 text-xs",children:["(",l("is_text_short")," : ",ee.toFixed(2)," cr + ",we," ",we>1?l("is_image_many"):l("is_image_one")," :"," ",(se-ee).toFixed(2)," cr",V?l("is_incl_size_guide"):"",")"]}
1),ie&&e.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:l("is_warn_no_shop")}),!ie&&!H&&Le&&e.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:l("is_warn_no_render")}),!ie&&H&&e.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:H.kind==="variation"?`${H.count} variations portent le nom « ${H.label} » — renommez-les pour générer.`:`${H.count} options de « ${H.group} » portent le nom « ${H.label} » — renommez-les pour générer.`}),!ie&&!Le&&!H&&us&&e.jsx("span",{className:"ml-2 text-xs text-amber-600 dark:text-amber-400",children:(Ke.length>1?l("is_warn_var_block_many"):l("is_warn_var_block_one")).replace("{n}",String(Ke.length))})]}),M?e.jsxs(ce,{disabled:u||!ye,className:"gap-2 bg-brand text-brand-foreground hover:bg-brand/90",onClick:()=>{!u&&ye&&_(Ve(),Te())},children:[e.jsx($s,{className:"size-4"})," ",M]}):e.jsxs(vs,{children:[e.jsx(Ns,{asChild:!0,children:e.jsxs(ce,{disabled:u||!ye,className:"gap-2 bg-brand text-brand-foreground hover:bg-brand/90",children:[e.jsx(dt,{className:"size-4"})," ",u?l("is_generated"):l("is_generate_btn").replace("{cr}",se.toFixed(2))]})}),e.jsxs(ys,{children:[e.jsxs(ws,{children:[e.jsx(ks,{children:l("is_confirm_gen")}),e.jsx(Ms,{asChild:!0,children:e.jsxs("div",{className:"space-y-1.5 pt-2 text-sm text-foreground",children:[e.jsx(de,{k:l("is_shop"),v:S.find(s=>s.id===k)?.name??"—"}),e.jsx(de,{k:l("is_text_model"),v:te[K]?.name??K}),e.jsx(de,{k:l("is_image_model"),v:B[z]?.name??z}),e.jsx(de,{k:l("is_resolution"),v:`${J} (${le(z,J,L).toFixed(2)} cr / image)`}),e.jsx(de,{k:l("is_total"),v:`${se.toFixed(2)} ${l("is_credits")} (${l("is_text_short")} : ${ee.toFixed(2)} cr + ${we} ${we>1?l("is_image_many"):l("is_image_one")} : ${(se-ee).toFixed(2)} cr${V?l("is_incl_size_guide"):""})`}),e.jsx("div",{className:"mt-3 rounded-md bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:l("is_cannot_cancel")})]})})]}),e.jsxs(Cs,{children:[e.jsx(Is,{children:l("is_cancel")}),e.jsx(Ss,{onClick:()=>{!u&&ye&&_(Ve(),Te())},children:l("is_confirm")})]})]})]})]})]})}function re({active:o,onClick:i,children:x}){return e.jsx("button",{type:"button",onClick:i,className:O("rounded-full px-2.5 py-1 transition",o?"bg-foreground text-background":"text-muted-foreground hover:bg-accent"),children:x})}function Me({icon:o,title:i}){return e.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[e.jsx("span",{className:"grid size-8 shrink-0 place-items-center rounded-full bg-brand/10 text-brand",children:o}),e.jsx("span",{children:i})]})}function Ce({label:o,children:i}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(mt,{className:"text-xs text-muted-foreground",children:o}),i]})}function de({k:o,v:i}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/50 py-1 last:border-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e.jsx("span",{className:"font-medium",children:i})]})}const Jt=["category","title","images","variations","materials","dimensions","description","shippingPrice","shippingFree","currency","tags","variationPrices","source"],Xt=["title","images","shippingPrice","shippingFree","currency","variations","details","description","variationPrices","source"];function js(o,i,x=!1){if(!o||typeof o!="object"||Array.isArray(o))return o;const u=o,g={};for(const N of i)N in u&&(g[N]=u[N]);if(x)return g;for(const N of Object.keys(u))N in g||(g[N]=u[N]);return g}function Wt({ali:o,etsy:i}){const[x,u]=p.useState(!1),[g,N]=p.useState(o?"ali":"etsy"),{t:_}=pe();if(!o&&!i)return null;const b=g==="ali"?js(o,Xt,!0):js(i,Jt);return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>u(!0),title:_("is_debug_extraction"),className:"fixed bottom-4 right-4 z-40 flex h-8 w-8 items-center justify-center rounded-full border bg-card/90 text-[11px] font-mono text-muted-foreground shadow-sm backdrop-blur hover:bg-accent",children:"{}"}),x&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-end bg-black/30 p-4",onClick:()=>u(!1),children:e.jsxs("div",{className:"flex h-[70vh] w-full max-w-xl flex-col rounded-lg border bg-card shadow-xl",onClick:M=>M.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b px-3 py-2",children:[e.jsxs("div",{className:"flex gap-1 text-[11px]",children:[o&&e.jsx("button",{type:"button",onClick:()=>
1N("ali"),className:O("rounded px-2 py-0.5",g==="ali"?"bg-foreground text-background":"hover:bg-accent"),children:"AliExpress"}),i&&e.jsx("button",{type:"button",onClick:()=>N("etsy"),className:O("rounded px-2 py-0.5",g==="etsy"?"bg-foreground text-background":"hover:bg-accent"),children:"Etsy"})]}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded p-1 hover:bg-accent",children:e.jsx(es,{className:"size-4"})})]}),e.jsx("pre",{className:"flex-1 overflow-auto rounded-b-lg bg-muted/40 p-3 text-[10px] leading-snug",children:b?JSON.stringify(b,null,2):_("is_no_extraction")})]})})]})}function Qt({cfg:o,onChange:i}){const[x,u]=p.useState(null),[g,N]=p.useState(null),{items:_}=Ze(),{t:b}=pe(),M=(c,j)=>{const C={...o.shots};j<=0?delete C[c]:C[c]=Math.max(0,j),i(C)},S=(c,j)=>ss.reduce((C,m)=>C+(o.shots[`${xe(c,j)}:${m}`]||0),0),D=(c,j,C)=>o.shots[`${xe(c,j)}:${C}`]||0,l=c=>`custom:${c.id}`,P=c=>o.shots[l(c)]||0;return e.jsxs("div",{className:"w-full text-xs",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-center gap-1.5 text-[12px] font-bold",children:[e.jsx("button",{type:"button",onClick:()=>{u(null),N(null)},className:O("underline underline-offset-4 hover:text-brand",!x&&"text-brand"),children:b("is_render")}),x&&e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"size-3 opacity-50"}),e.jsx("button",{type:"button",onClick:()=>N(null),className:O("underline underline-offset-4 hover:text-brand",!g&&"text-brand"),children:Ie(b,x)})]}),x&&g&&e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"size-3 opacity-50"}),e.jsx("span",{className:"text-brand underline underline-offset-4",children:Se(b,g)})]})]}),x?g?e.jsx(Rs,{ambiance:x,wear:g,countForAngle:D,setQty:M}):e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:["unworn","worn"].map(c=>e.jsx(Oe,{label:Se(b,c),count:S(x,c),onClick:()=>N(c)},c))}):e.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[["studio","lifestyle"].map(c=>{const j=S(c,"unworn")+S(c,"worn");return e.jsx(Oe,{label:Ie(b,c),info:ze[c],count:j,onClick:()=>u(c)},c)}),e.jsx(Pe,{label:Vs,info:ze.scene,count:o.shots["scene_reimagine:scène"]||0,onChange:c=>M("scene_reimagine:scène",c)}),_.map(c=>e.jsx(Pe,{label:c.title,count:P(c),onChange:j=>M(l(c),j)},c.id))]})]})}function Zt({optionName:o,image:i,cfg:x,pool:u,sourceIds:g,onRenameOption:N,onRemoveOption:_,removeDescription:b,onSetImage:M,onChangeShots:S}){const[D,l]=p.useState(o),[P,c]=p.useState(!1),{t:j}=pe();p.useEffect(()=>{l(o)},[o]);const C=Object.values(x.shots).reduce((m,k)=>m+(k||0),0);return e.jsxs("div",{className:O("flex min-h-36 items-start gap-3 rounded-lg border p-2 transition",C>0&&"ring-1 ring-brand/40"),children:[e.jsxs("div",{className:"relative size-32 shrink-0",children:[e.jsxs(zs,{open:P,onOpenChange:c,children:[e.jsx(Os,{asChild:!0,children:e.jsx("button",{type:"button",className:"size-32 overflow-hidden rounded border bg-muted hover:opacity-90",title:j("is_link_image_title"),"aria-label":j("is_link_image_title"),children:i?e.jsx("img",{src:i,alt:"",className:"size-full object-cover"}):e.jsx("span",{className:"grid size-full place-items-center px-1 text-center text-[10px] text-muted-foreground",children:j("is_link_image_short")})})}),e.jsxs(Ps,{side:"bottom",align:"start",collisionPadding:16,className:"w-[min(300px,calc(100vw-2rem))] p-2",children:[e.jsx("div",{className:"mb-1.5 text-[10px] font-semibold uppercase text-muted-foreground",children:j("is_choose_image")}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[u.map((m,k)=>e.jsx("button",{type:"button",title:`${m.source.toUpperCase()} #${g[k]}`,"aria-label":`${m.source.toUpperCase()} #${g[k]}`,onClick:()=>{M(m.url),c(!1)},className:O("size-12 overflow-hidden rounded border-2 transition",m.url===i?"border-foreground":"border-transparent hover:border-muted-foreground"),children:e.jsx("img",{src:m.url,alt:"",className:"size-full object-cover"})},m.url+k)),i&&e.jsx("button",{type:"button",onClick:()=>{M(null),c(!1)},"aria-label":j("is_none_f"),className:"grid size-12 place-items-center rounded border border-dashed text-[10px] text-muted-foreground hover:bg-accent",children:j("is_none_f")})]})]})]}),C>0&&e.jsx("span",{className:"absolute bottom-1 left-1 rounded-full bg-brand px-1.5 py-0.5 text-[10px] font-bold text-brand-foreground",children:C})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(xt,{value:D,onChange:m=>l(m.target.value),onBlur:()=>{D.trim()&&D!==o&&N(D.trim())},className:"h-7 flex-1 text-xs"}),e.jsx(Es,{onConfirm:_,title:j("is_remove_option_q").replace("{val}",o),description:b??j(i?"is_remove_opt_with_img":"is_remove_opt_no_img"),className:"grid size-7 shrink-0 place-items-center rounded-md text-destructive hover:bg-destructive/10",triggerTitle:j("is_remove_option"),children:e.jsx(wt,{className:"size-3"})})]}),i?e.jsx(Qt,{cfg:x,onChange:S}):e.jsx("p",{className:"text-[11px] text-muted-foreground",children:j("is_no_assoc_img")})]})]})}function en({title:o,subtitle:i,items:x,images:u,sourceIds:g,dragIdx:N,setDragIdx:_,moveItem:b,setImages:M,required:S,onDetach:D,clampShots:l}){return x.length===0?null:e.jsxs("div",{className:"space-y-2",children:[(o||i)&&e.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[o&&e.jsx("h3",{className:"text-sm font-semibold",children:o}),i&&e.jsx("span",{className:O("text-[11px]",S?"text-amber-600 dar
1k:text-amber-400":"text-muted-foreground"),children:i})]}),e.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:x.map(({p:P,i:c})=>e.jsx(sn,{src:P.url,source:P.source,sourceId:g[c],cfg:u[c]??{selected:!0,shots:{}},isDragging:N===c,onDragStart:()=>_(c),onDragEnd:()=>_(null),onDragOver:j=>j.preventDefault(),onDrop:j=>{j.preventDefault(),N!=null&&b(N,c),_(null)},onChangeShots:j=>{const C=l?l(c,j):j;M(m=>({...m,[c]:{selected:Object.values(C).some(k=>k>0),shots:C}}))},onDetach:S&&D?()=>D(c):void 0},P.url))})]})}function sn({src:o,source:i,sourceId:x,cfg:u,isDragging:g,onChangeShots:N,onDragStart:_,onDragEnd:b,onDragOver:M,onDrop:S,onDetach:D}){const[l,P]=p.useState(null),[c,j]=p.useState(null),{items:C}=Ze(),{t:m}=pe(),k=Object.values(u.shots).reduce((y,z)=>y+(z||0),0),R=(y,z)=>{const A={...u.shots};z<=0?delete A[y]:A[y]=Math.max(0,z),N(A)},Y=(y,z)=>ss.reduce((A,Q)=>A+(u.shots[`${xe(y,z)}:${Q}`]||0),0),ge=(y,z,A)=>u.shots[`${xe(y,z)}:${A}`]||0,fe=y=>`custom:${y.id}`,K=y=>u.shots[fe(y)]||0;return e.jsxs("div",{draggable:!0,onDragStart:_,onDragEnd:b,onDragOver:M,onDrop:S,className:O("group flex min-h-36 items-center gap-3 rounded-lg border p-2 transition",k>0&&"ring-1 ring-brand/40",g&&"opacity-30 ring-2 ring-brand"),children:[e.jsxs("div",{className:"relative size-32 shrink-0 self-center",children:[e.jsx("img",{src:o,alt:"",loading:"lazy",className:"size-32 cursor-grab rounded object-cover active:cursor-grabbing pointer-events-none"}),e.jsxs("span",{className:"absolute left-1 top-1 rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase text-white",style:Gt[i],children:[i," #",x]}),k>0&&e.jsx("span",{className:"absolute bottom-1 left-1 rounded-full bg-brand px-1.5 py-0.5 text-[10px] font-bold text-brand-foreground",children:k}),D&&e.jsxs(vs,{children:[e.jsx(Ns,{asChild:!0,children:e.jsx("button",{type:"button",title:m("is_move_supp_title"),className:"absolute right-1 top-1 grid size-5 place-items-center rounded-full bg-background/90 text-muted-foreground opacity-0 transition group-hover:opacity-100 hover:bg-destructive hover:text-destructive-foreground",children:e.jsx(es,{className:"size-3"})})}),e.jsxs(ys,{children:[e.jsxs(ws,{children:[e.jsx(ks,{children:m("is_move_supp_q")}),e.jsxs(Ms,{children:[m("is_move_supp_desc_a"),e.jsx("strong",{children:m("is_irreversible")}),m("is_move_supp_desc_b")]})]}),e.jsxs(Cs,{children:[e.jsx(Is,{children:m("is_cancel")}),e.jsx(Ss,{onClick:D,children:m("is_move")})]})]})]}),e.jsx("div",{className:"absolute bottom-1 right-1 grid size-5 place-items-center rounded-full bg-background/90 text-muted-foreground opacity-0 group-hover:opacity-100",children:e.jsx(Ds,{className:"size-3"})})]}),e.jsxs("div",{className:"min-w-0 flex-1 self-center text-xs",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-center gap-1.5 text-[12px] font-bold",children:[e.jsx("button",{type:"button",onClick:()=>{P(null),j(null)},className:O("underline underline-offset-4 hover:text-brand",!l&&"text-brand"),children:m("is_render")}),l&&e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"size-3 opacity-50"}),e.jsx("button",{type:"button",onClick:()=>j(null),className:O("underline underline-offset-4 hover:text-brand",!c&&"text-brand"),children:Ie(m,l)})]}),l&&c&&e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"size-3 opacity-50"}),e.jsx("span",{className:"text-brand underline underline-offset-4",children:Se(m,c)})]})]}),e.jsx("div",{className:"w-full",children:l?c?e.jsx(Rs,{ambiance:l,wear:c,countForAngle:ge,setQty:R}):e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:["unworn","worn"].map(y=>e.jsx(Oe,{label:Se(m,y),count:Y(l,y),onClick:()=>j(y)},y))}):e.jsxs("div",{className:"grid grid-cols-2 gap-1.5",children:[["studio","lifestyle"].map(y=>{const z=Y(y,"unworn")+Y(y,"worn");return e.jsx(Oe,{label:Ie(m,y),info:ze[y],count:z,onClick:()=>P(y)},y)}),e.jsx(Pe,{label:Vs,info:ze.scene,count:u.shots["scene_reimagine:scène"]||0,onChange:y=>R("scene_reimagine:scène",y)}),C.map(y=>{const z=fe(y),A=K(y);return e.jsx(Pe,{label:y.title,count:A,onChange:Q=>R(z,Q)},y.id)})]})})]})]})}
1function Rs({ambiance:o,wear:i,countForAngle:x,setQty:u}){const[g,N]=p.useState(null);return e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:ss.map(_=>{const b=x(o,i,_),M=`${xe(o,i)}:${_}`,S=g===_;return e.jsxs("div",{className:"rounded-md border bg-background/40",children:[e.jsxs("button",{type:"button",onClick:()=>{!S&&b===0&&u(M,1),N(S?null:_)},className:O("flex w-full items-center justify-between gap-1 rounded-md px-2 py-2 text-left text-xs font-medium hover:bg-accent",b>0&&"ring-1 ring-brand/40"),children:[e.jsx("span",{className:"truncate capitalize",children:_}),b>0&&e.jsx("span",{className:"rounded-full bg-brand/15 px-1.5 py-0.5 text-[10px] text-brand",children:b})]}),S&&e.jsxs("div",{className:"flex items-center justify-center gap-2 border-t px-1 py-1",children:[e.jsx("button",{type:"button",onClick:()=>u(M,b-1),disabled:b<=0,className:"grid size-6 place-items-center rounded border disabled:opacity-30",children:e.jsx(Fs,{className:"size-3"})}),e.jsx("span",{className:"w-5 text-center text-xs tabular-nums",children:b}),e.jsx("button",{type:"button",onClick:()=>u(M,b+1),className:"grid size-6 place-items-center rounded border",children:e.jsx(ue,{className:"size-3"})})]})]},_)})})}const Vs="Texte & inscriptions",ze={studio:"Produit seul sur fond uni, sans aucun texte ni 
1inscription.",lifestyle:"Produit mis en scène dans son univers, sans aucun texte ni inscription.",scene:"Pour les visuels contenant du texte : le texte d'origine est conservé et rendu plus lisible."};function Ts({text:o}){return e.jsx(pt,{delayDuration:150,children:e.jsxs(gt,{children:[e.jsx(ft,{asChild:!0,children:e.jsx("span",{role:"button",tabIndex:0,"aria-label":"Informations",onClick:i=>{i.stopPropagation(),i.preventDefault()},className:"inline-flex shrink-0 items-center text-muted-foreground hover:text-foreground",children:e.jsx(jt,{className:"size-3.5"})})}),e.jsx(ht,{side:"top",className:"max-w-[15rem] text-[11px] leading-relaxed",children:o})]})})}function Oe({label:o,count:i,onClick:x,info:u}){return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:x,className:"w-full rounded-md border px-2 py-3 pr-6 text-left text-xs font-medium hover:bg-accent",children:[o,i>0&&e.jsx("span",{className:"ml-1 rounded-full bg-brand/15 px-1.5 py-0.5 text-[10px] text-brand",children:i}
1)]}),u&&e.jsx("span",{className:"absolute right-1.5 top-1.5",children:e.jsx(Ts,{text:u})})]})}function Pe({label:o,count:i,onChange:x,info:u}){const[g,N]=p.useState(!1);return e.jsxs("div",{className:"relative rounded-md border",children:[u&&e.jsx("span",{className:"absolute right-1.5 top-1.5 z-10",children:e.jsx(Ts,{text:u})}),e.jsxs("button",{type:"button",onClick:()=>{!g&&i===0&&x(1),N(!g)},className:O("flex w-full items-center justify-between gap-1 rounded-md px-2 py-3 text-left text-xs font-medium hover:bg-accent",i>0&&"ring-1 ring-brand/40"),children:[e.jsx("span",{className:O("truncate",u&&"pr-4"),children:o}),i>0&&e.jsx("span",{className:"rounded-full bg-brand/15 px-1.5 py-0.5 text-[10px] text-brand",children:i})]}),g&&e.jsxs("div",{className:"flex items-center justify-center gap-2 border-t px-1 py-1",children:[e.jsx("button",{type:"button",onClick:()=>x(Math.max(0,i-1)),disabled:i<=0,className:"grid size-6 place-items-center rounded border disabled:opacity-30",children:e.jsx(Fs,{className:"size-3"})}),e.jsx("span",{className:"w-5 text-center text-xs tabular-nums",children:i}),e.jsx("button",{type:"button",onClick:()=>x(i+1),className:"grid size-6 place-items-center rounded border",children:e.jsx(ue,{className:"size-3"})})]})]})}export{kn as IntermediateStep};

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.