(function () { 'use strict'; window.industryRenderers ??= {}; function scene(svg, config, kit, title, subtitle, phases, note) { const {anime,el}=kit; const C={bg:'#0b1424',panel:'#15243a',line:'#68809d',ink:'#edf4ff',muted:'#b2c4da',cyan:'#57d9ed',green:'#82e0b0',amber:'#ffd078',red:'#ff8a94'}; const D=Number.isFinite(+config.duration)&&+config.duration>0?+config.duration:6000; const tl=anime.createTimeline({autoplay:false,defaults:{ease:'linear'}}); function e(t,a={},text='',p=svg){return el(t,a,text,p);} function g(){return e('g');} function rect(x,y,w,h,fill=C.panel,stroke=C.line,p=svg,r=8){return e('rect',{x,y,width:w,height:h,rx:r,fill,stroke,'stroke-width':2},'',p);} function text(x,y,s,fill=C.ink,size=18,p=svg){return e('text',{x,y,fill,'font-size':size,'font-family':'system-ui, sans-serif'},s,p);} function path(d,color=C.line,width=3,p=svg){return e('path',{d,fill:'none',stroke:color,'stroke-width':width,'stroke-linecap':'round','stroke-linejoin':'round'},'',p);} function circle(x,y,r,fill=C.cyan,p=svg){return e('circle',{cx:x,cy:y,r,fill},'',p);} const tracks=new WeakMap(); function tween(o,attrs,start,end){ let previous=tracks.get(o);if(!previous){previous={};tracks.set(o,previous);} for(const [key,values] of Object.entries(attrs)){ const old=previous[key]; // Anime v4 needs explicit holds across gaps for reverse seeking. if(old && start>old.end)tl.add(o,{[key]:[old.value,old.value],duration:(start-old.end)*D/6000},old.end*D/6000); previous[key]={end,value:values[values.length-1]}; } tl.add(o,{...attrs,duration:(end-start)*D/6000},start*D/6000); } function reveal(o,start,end= start+650){o.setAttribute('opacity','0');tween(o,{opacity:[0,1]},start,end);} function flow(d,start,end,color=C.cyan,width=5){const p=path(d,color,width);const len=p.getTotalLength();p.setAttribute('stroke-dasharray',len);p.setAttribute('stroke-dashoffset',len);tween(p,{strokeDashoffset:[len,0]},start,end);return p;} function parcel(x,y,color=C.amber){const p=g();rect(x,y,36,28,color,'#0b1424',p,3);path(`M${x+18} ${y} V${y+28}`,'#736146',2,p);return p;} function person(x,y,color=C.cyan){const p=g();circle(x,y,10,color,p);path(`M${x} ${y+15} V${y+43} M${x-15} ${y+25} H${x+15} M${x} ${y+43} L${x-12} ${y+60} M${x} ${y+43} L${x+12} ${y+60}`,color,6,p);return p;} function gear(x,y,r,color=C.line){const p=g();for(let i=0;i<12;i++){const a=i*Math.PI/6;path(`M${x+Math.cos(a)*(r-5)} ${y+Math.sin(a)*(r-5)} L${x+Math.cos(a)*(r+7)} ${y+Math.sin(a)*(r+7)}`,color,8,p);}circle(x,y,r,color,p);circle(x,y,r*.45,C.bg,p);return p;} rect(10,10,940,520,C.bg,C.panel,svg,16); const heading=text(32,43,title,C.ink,25); const words=subtitle.split(' ');let line='',row=0;for(const w of words){if((line+' '+w).length>104){text(32,70+row*19,line,C.muted,16);line=w;row++;}else line+=(line?' ':'')+w;}if(line)text(32,70+row*19,line,C.muted,16); path('M32 426 H928',C.line,1); phases.forEach((s,i)=>{const x=47+i*183;circle(x,455,13,C.panel);const dot=circle(x,455,11,C.cyan);dot.setAttribute('opacity','.18');tween(dot,{opacity:[.18,1]},i*1200,i*1200+700);text(x+21,461,s,C.ink,16);}); text(32,510,note,C.muted,16); tween(heading,{opacity:[1,1]},0,6000); return {C,D,tl,e,g,rect,text,path,circle,tween,reveal,flow,parcel,person,gear}; } window.industryRenderers["logistics-hub-connection-recovery"] = function(svg, config, kit) { const s=scene(svg,config,kit,"Hub sorting: recover a missed connection","Follow a late parcel from induction through sorting, a missed departure, exception staging and a later connection.",["Induct", "Read & sort", "Cutoff missed", "Stage safely", "Reconnect"],"Cyan = planned path \u00b7 Amber = late parcel \u00b7 Green = recovery connection"); const {C,tl,g,rect,text,path,circle,tween,reveal,flow,parcel}=s; text(47,117,'INDUCTION',C.muted,17);text(307,117,'SCAN / DIVERT',C.muted,17);text(701,117,'DEPARTURE LANES',C.muted,17); // A real conveyor: twin rails and repeated rollers, not process boxes. rect(45,192,438,74,'#23354a',C.line); for(let x=58;x<475;x+=22) path(`M${x} 200 V258`,C.line,2); path('M465 212 L569 161 H857 M465 246 L569 337 H857',C.line,18); path('M465 212 L569 161 H857 M465 246 L569 337 H857',C.bg,11); path('M303 187 V142 H387 V187',C.cyan,7);path('M317 177 H373',C.cyan,2); text(298,292,'Identity retained',C.muted,16); // Docked truck silhouettes. function truck(x,y,color){const p=g();rect(x,y,116,51,C.panel,color,p,3);path(`M${x+116} ${y+15} H${x+142} L${x+156} ${y+33} V${y+51} H${x+116}`,color,3,p);circle(x+27,y+55,10,C.line,p);circle(x+128,y+55,10,C.line,p);return p;} const first=truck(717,130,C.cyan);tween(first,{opacity:[1,.3]},2400,2900);text(709,215,'Original connection',C.ink,16); const second=truck(717,307,C.green);text(705,395,String(config.recoveryConnection||'Later connection').slice(0,22),C.green,17); rect(516,246,146,44,C.bg,C.amber);text(529,274,'HOLD / ID',C.amber,16); const gate=path('M593 139 V184',C.red,6);reveal(gate,2400,2700); const late=text(511,137,'Cutoff closed',C.red,17);reveal(late,2400,2850); flow('M71 229 H343',0,1300);const oldRoute=flow('M343 229 H462 L566 161 H589',1300,2400);tween(oldRoute,{opacity:[1,.22]},2400,2850); const p=parcel(70,215);tween(p,{translateX:[0,271]},0,1200);tween(p,{translateX:[271,473],translateY:[0,-68]},1200,2300); tween(p,{translateX:[473,544],translateY:[-68,39]},2800,3600); flow('M577 184 V244 M632 290 V337 H709',3000,4700,C.amber); tween(p,{translateX:[544,537],translateY:[39,108]},3800,4500);tween(p,{translateX:[537,680],translateY:[108,108]},4800,5650); const stamp=text(47,369,'Recovery preserves the parcel ID,',C.green,18);text(47,395,'not the original departure.',C.muted,17);reveal(stamp,4800,5500); return tl; }; window.industryRenderers["logistics-port-crane-yard"] = function(svg, config, kit) { const s=scene(svg,config,kit,"Port coordination: berth, crane and yard","A container moves only after berth access, crane clearance and a yard slot align; a blocked lane prompts reassignment.",["Berth ready", "Lift approved", "Lane blocked", "Reassign slot", "Yard receipt"],"Amber = container \u00b7 Red = unavailable lane \u00b7 Green = assigned yard slot"); const {C,tl,g,rect,text,path,circle,tween,reveal,flow}=s; rect(32,303,343,105,'#102e46','#102e46');for(let y=325;y<402;y+=23)path(`M44 ${y} Q70 ${y-9} 96 ${y} T148 ${y} T200 ${y} T252 ${y} T304 ${y}`,C.line,1); path('M54 267 H340 L308 326 H90 Z',C.cyan,3);rect(64,226,47,41,C.panel,C.cyan);rect(77,209,21,17,C.panel,C.cyan); for(let x=122;x<306;x+=59)rect(x,238,53,28,C.panel,C.line,undefined,2); text(49,376,'BERTH / VESSEL',C.cyan,17); rect(375,309,547,99,'#23354a','#23354a');path('M386 315 H916',C.muted,3); // Quayside gantry with boom, portal legs and cable. path('M401 309 V137 H630 V309 M389 309 L438 137 M642 309 L595 137 M208 139 H671',C.ink,7); path('M426 138 L516 101 L610 138',C.line,4); const trolley=rect(257,129,42,22,C.cyan,C.cyan);const cable=path('M278 151 V221',C.amber,3); tween(cable,{d:['M278 151 V221','M278 151 V155']},1200,2200); tween(cable,{d:['M278 151 V155','M554 151 V155']},2600,3700);tween(trolley,{translateX:[0,276]},2600,3700); tween(cable,{d:['M554 151 V155','M554 151 V316']},3900,4700);tween(cable,{opacity:[1,0]},4700,4800); const lift=g();rect(253,235,52,30,C.amber,C.amber,lift,2);path('M253 235 L279 221 L305 235',C.amber,2,lift); tween(lift,{translateY:[0,-66]},1200,2200);tween(lift,{translateX:[0,276],translateY:[-66,-66]},2600,3700);tween(lift,{translateX:[276,276],translateY:[-66,95]},3900,4700); text(48,119,'Ship secured',C.green,17);text(446,186,'Lift zone',C.muted,16); rect(467,340,175,28,C.bg,C.line);path('M477 355 H627',C.muted,2);text(468,397,'Transfer vehicle',C.ink,16); const vehicle=g();rect(502,345,90,17,C.panel,C.green,vehicle,3);circle(519,368,7,C.line,vehicle);circle(579,368,7,C.line,vehicle);tween(vehicle,{translateX:[0,263]},4800,5800);tween(lift,{translateX:[276,539],translateY:[95,95]},4800,5800); text(709,117,'YARD ASSIGNMENT',C.muted,17); for(let y=146;y<239;y+=43)for(let x=712;x<881;x+=55)rect(x,y,47,31,C.panel,C.line,undefined,2); path('M733 250 L754 273 M754 250 L733 273',C.red,4);text(767,287,'Lane A held',C.red,16); flow('M646 357 H693 V293 H866 V330',3600,4850,C.green); rect(774,331,109,53,C.bg,C.green);text(783,403,'Slot '+String(config.yardSlot||'B').slice(0,8)+' ready',C.green,16); const ok=text(433,252,'Release → transfer → receipt',C.green,16);reveal(ok,4800,5700); svg.append(vehicle,lift); return tl; }; })();