# [JavaScript (Node.js)], 277 bytes

[JavaScript (Node.js)]: https://nodejs.org

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

    f=(n,i=0)=>n?`01238887654`.replace(e=/\d/g,y=>`7654${i++?'|':' '}0123
    `.replace(e,x=>"_ \\/.'|"[q=y/2&2|x>3,y&8?1:(k=8-~~'80764467'[j=~~('0x'+(1e6+'1023405671567899AB99A899CB99C')[y%4+~-(n/10**q%10)*4])]>>x%4&1?'0122233346545'[j]:2045>>j&1)^0xCC6600>>k*4+q&1]))+f(n/1e4|0,1):''

[Try it online!](https://tio.run/##VVDZboMwEHzvV0RRw9qYBF8YB8lGLZ@R0CZKnCiHIEdVgUr5der0qX0YjbQ7O5rZ4/pzfd/cDpePaVVv3TDsDKqig6HY2CpfUcaF1jpViVzNbu5yXm8cciZebuN91Bq7emyevw6E5NBBBiP4fpw8/RFHjbHj99FyGc@gGy@upo15wLvGiqgNdM4ydDJ62vegaaqkVCksjqbvEdAGCGJOEWCUC0kTlTIPPZ@/vHp4LjwXgBftRJJ@iqqY0TC8ThjFoSxxaW0zkQHLwUfiXAghfdjE25cZpzKx9hgw/EabolCKUmtPoSTXgJUYk93DzMmORgxnAMOmru712c3O9R7tkG8oE4yf/k/nv28SnGE8/AA "JavaScript (Node.js) – Try It Online")

Or [**256 bytes**](https://tio.run/##VVBta4MwGPzeXzEKmkSr5s2YCols/gzrVrGxrC1a2zEUxL/u4j5tH46D5x6Ou7tU39Wzfnzev4K2O5llaVSrdJsdMaFMSpmImB/Dh7nfqtpAo6LDKTrvRqWPqzKtX5s/@m5QevvxcjhEIZi2Ra/GiLp0GjTbja7MSAqvSgbzDCROBOciAcVFzTMEeAA@JEb4gGDKOI5FQizkfv/6ZmE5t5wDVIwO9@cAthHBntc7BCOPl6jUenC4SzJgI1HKGOM2X2zty5RiHmt9cQl6x0OeC4Gx1leP@71LSoT8ZjUztgxKAVjqrn12NxPeujNsoO3HY4Q2/6/7310YJQgtPw) if an extra `|` at the top is acceptable.