# JavaScript (ES6) 272 <s>277 271</s>

*Edit* bug fix

*Edit 2* saved 6 bytes thx @L.Serné

*Edit 3* bug fix again

<!-- language-all: lang-js -->

    (w,h,z=(s,q=3,i=h)=>'|  '.slice(0,q)+s.repeat(w).substr(i%2*6+q,w*6-q-~-q)+`  |
    `.slice(~q))=>eval("t=z(' _____',0,0)+z('|_   _|     ',2,--h)+z(b=' _) (_   _  ')+z(c='|_   _|_( )_',0);for(a='|_   _| (_) ';--h;)t+=z(a,2)+z(b)+z(c,0)")+z(a,2)+z(' _) (_      ')+z('|_____',1)

*Less golfed*

    (w,h,
      z=(s,q=3,i=h)=>'|  '.slice(0,q)+s.repeat(w).substr(i%2*6+q,w*6-q-~-q)+'  |\n'.slice(~q),
      a='|_   _| (_) ',
      b=' _) (_   _  ',
      c='|_   _|_( )_',
      t=z(' _____',0,0)+z('|_   _|     ',2,--h)+z(b)+z(c,0)
    )=>{
      for(;--h;)
        t+=z(a,2)+z(b)+z(c,0);
      return t+z(a,2)+z(' _) (_      ')+z('|_____',1)
    }

**Test**

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

    F=
    (w,h,z=(s,q=3,i=h)=>'|  '.slice(0,q)+s.repeat(w).substr(i%2*6+q,w*6-q-~-q)+`  |
    `.slice(~q))=>eval("t=z(' _____',0,0)+z('|_   _|     ',2,--h)+z(b=' _) (_   _  ')+z(c='|_   _|_( )_',0);for(a='|_   _| (_) ';--h;)t+=z(a,2)+z(b)+z(c,0)")+z(a,2)+z(' _) (_      ')+z('|_____',1)

    function update() {
      var w=+W.value,h=+H.value
      O.textContent=F(w,h)
    }

    update()

<!-- language: lang-html -->

    W<input id=W value=2 oninput='update()' type=number min=2>
    H<input id=H value=2 oninput='update()' type=number min=2>
    <pre id=O></pre>

<!-- end snippet -->