/* Original conceptual industry scenes; Anime.js v4. */ (function(){ window.industryRenderers ??= {}; function scene(svg, config, kit, title, subtitle, phases) { const {el,anime}=kit, p=Number.isFinite(Number(config.phaseMs)) && Number(config.phaseMs)>0 ? Number(config.phaseMs) : 1200; const c={ink:'#e5edf7',muted:'#93a8bf',blue:'#63baff',green:'#6ce1b4',amber:'#ffc56b',red:'#ff8091',bg:'#101e30',line:'#314961'}; const E=(tag,a={},t='',parent=svg)=>el(tag,a,t,parent); const text=(x,y,t,size=18,color=c.ink)=>E('text',{x,y,fill:color,'font-size':size,'font-family':'system-ui'},t); const path=(d,color=c.line,w=5)=>E('path',{d,fill:'none',stroke:color,'stroke-width':w,'stroke-linecap':'round','stroke-linejoin':'round'}); const rect=(x,y,w,h,color=c.bg,stroke=c.line,rx=8)=>E('rect',{x,y,width:w,height:h,rx,fill:color,stroke,'stroke-width':2}); const circle=(x,y,r,color=c.blue)=>E('circle',{cx:x,cy:y,r,fill:color}); E('rect',{width:960,height:540,fill:'#091321'}); text(32,38,title,26);text(32,67,subtitle,16,c.muted); path('M32 88 H928',c.line,1); const tl=anime.createTimeline({autoplay:false,defaults:{ease:'linear'}}); const anchor=E('g');tl.add(anchor,{opacity:[1,1],duration:p*5},0); function show(node,step){node.setAttribute('opacity','.15');tl.add(node,{opacity:[.15,1],duration:p*.65},step*p);return node;} function flow(d,step,color=c.green){const n=path(d,color,5);const len=n.getTotalLength();n.setAttribute('stroke-dasharray',len);n.setAttribute('stroke-dashoffset',len);tl.add(n,{'stroke-dashoffset':[len,0],duration:p*.75},step*p);return n;} function move(n,x0,y0,x1,y1,step){tl.add(n,{cx:[x0,x1],cy:[y0,y1],duration:p*.75},step*p);} function note(x,y,w,heading,detail,color=c.green,step=0){rect(x,y,w,58);show(rect(x,y,5,58,color,color,0),step);text(x+16,y+24,heading,18,color);text(x+16,y+46,detail,16,c.muted);} function valve(x,y,step){const n=path(`M${x-10} ${y-10} L${x+10} ${y+10} M${x+10} ${y-10} L${x-10} ${y+10}`,c.red,4);show(n,step);} phases.forEach((s,i)=>{const x=32+i*182;rect(x,465,174,42,'#132338');show(rect(x,465,4,42,c.blue,c.blue,0),i);text(x+12,491,`${i+1} ${s}`,16);}); text(32,529,'Conceptual sequence · illustrative timing · not an operating procedure',16,c.muted); return {E,text,path,rect,circle,tl,show,flow,move,note,valve,c,p}; } window.industryRenderers['pharma-batch-genealogy'] = function(svg,config,kit){ const s=scene(svg,config,kit,"Batch genealogy: hold, then release","A quality hold propagates to descendants; disposition restores only the accepted branch.",["Trace inputs", "Blend batch", "Hold lineage", "Review evidence", "Release branch"]); const {text,path,rect,circle,show,flow,note,c}=s; function drum(x,y,label){rect(x,y,94,72,'#18314a',c.blue,12);path(`M${x} ${y+16} H${x+94} M${x} ${y+56} H${x+94}`,c.line,2);text(x+10,y+42,label,18);} drum(40,123,'Lot A');drum(40,256,'Lot B'); path('M134 159 H220 V215 H290 M134 292 H220 V215'); rect(290,151,150,140,'#1b3044',c.blue,35);path('M365 125 V247 M335 234 L395 256 M335 256 L395 234',c.blue,4);text(309,324,'Blend batch',18); flow('M134 159 H220 V215 H290',0,c.blue);flow('M134 292 H220 V215 H290',0,c.blue); path('M440 215 H510 V155 H577 M510 215 V300 H577');flow('M440 215 H510 V155 H577 M510 215 V300 H577',1,c.blue); function pack(y,label){rect(577,y,100,72,'#18314a',c.blue);path(`M602 ${y} V${y+72}`,c.line,2);text(614,y+42,label,18);} pack(119,'P1');pack(264,'P2'); show(rect(555,103,145,105,'none',c.amber),2);show(rect(555,249,145,105,'none',c.amber),2); text(704,131,'P1 · evidence accepted',16,c.green);text(717,288,'P2 · hold retained',16,c.amber); flow('M677 155 H885',4,c.green);show(circle(889,155,8,c.green),4); note(274,366,350,'Disposition follows evidence','Not every descendant is released',c.green,4); note(39,366,218,'Quality review','Trace the affected lots',c.amber,3); const count=Math.max(2,Math.min(5,Math.round(Number(config.packCount)||3))); const packs=[]; for(let i=0;i