Expand compressed brain-flak
Brain-Flak, 952 916 818 bytes

{(({})[(((()()()()()){}){}){}])((){[()](&lt;{}&gt;)}{}){{}(({})()&lt;&gt;)(&lt;&gt;)}{}(&lt;&gt;)&lt;&gt;(({})[(((()()()){}){}()){({}[()])}{}])((){[()](&lt;{}&gt;)}{})({}&lt;&gt;{})&lt;&gt;(({})[((((()()()()()){}){})){}{}])((){[()](&lt;{}&gt;)}{})({}&lt;&gt;{})&lt;&gt;(({})[(((((()()()()()){}){}){}())){}{}])((){[()](&lt;{}&gt;)}{})({}&lt;&gt;{}){{}(&lt;(&lt;&gt;({})()()&lt;&gt;)&gt;)}{}&lt;&gt;(({})[(((()()()()()){}){}){}()])((){[()](&lt;{}&gt;)}{}){{}(({})[()])(&lt;&gt;)&lt;&gt;(&lt;({}&lt;{({}&lt;&gt;)&lt;&gt;}{}&gt;)&gt;)&lt;&gt;{({}&lt;&gt;)&lt;&gt;}{}(&lt;&gt;)}{}(&lt;&gt;)&lt;&gt;(({})[(((((()()()()()){})){}{}())){}{}])((){[()](&lt;{}&gt;)}{})({}&lt;&gt;{})&lt;&gt;(({})[((((()()()()()){}){})()){}{}])((){[()](&lt;{}&gt;)}{})({}&lt;&gt;{})&lt;&gt;(({})[(((((()()()()()){}){}){}())()){}{}])((){[()](&lt;{}&gt;)}{})({}&lt;&gt;{}){{}&lt;&gt;(&lt;(({})[()()])(&lt;&gt;)&lt;&gt;(&lt;({}&lt;{({}&lt;&gt;)&lt;&gt;}{}&gt;)&gt;)&lt;&gt;{({}&lt;&gt;)&lt;&gt;}{}&gt;)}{}&lt;&gt;(({})[(((((()()()()()){}){})()){}{}){}])((){[()](&lt;{}&gt;)}{}){{}{}(&lt;(&lt;&gt;{}&lt;&gt;)&gt;)}{}(&lt;&gt;)&lt;&gt;(&lt;({}&lt;{({}&lt;&gt;)&lt;&gt;}{}&gt;)&gt;)&lt;&gt;{({}&lt;&gt;)&lt;&gt;}{}&lt;&gt;}{}{({}&lt;&gt;)&lt;&gt;}&lt;&gt;


Saved 360 bytes by calculating opposing brackets relatively rather than from scratch (e.g. ')' = '(' + 1 instead of (((5 * 2) * 2) * 2) + 1)

Saved 34 bytes with some direct replacements from DJMcMayhem

Saved 10 bytes by overlapping the &gt;]} handling code

Saved 118 bytes by deduplicating rolls

Saved 40 bytes by taking advantage of the empty stack to simplify the first roll

Saved 48 bytes by marking EOF with -1, enabling more concise roll code

Saved 36 bytes by using the stock equals logic instead of my own

Saved 98 bytes thanks to Jo King finding a more efficient way to build the output

Try it online!

First time golfing in Brain-Flak, so there are probably some really big improvements, but it works. Lots of copy/paste to handle each bracket type, and big thanks to the automatic integer generator and the Roll snippet from here.

Explanation here, TIO formats it more easily

Bonus answer:

Compressed Brain-Flak 583 bytes

{((}|[((()))))|}|}|}||(){[)|(&lt;}|||}|{}((}|)&gt;|(&gt;||}(&gt;|&gt;((}|[((()))|}|})|{(}[)|||}||(){[)|(&lt;}|||}|(}&gt;}|&gt;((}|[(((()))))|}|}||}}||(){[)|(&lt;}|||}|(}&gt;}|&gt;((}|[((((()))))|}|}|})||}}||(){[)|(&lt;}|||}|(}&gt;}|{}(&lt;(&gt;(}|))&gt;||||}&gt;((}|[((()))))|}|}|})||(){[)|(&lt;}|||}|{}((}|[)||(&gt;|&gt;(&lt;(}&lt;{(}&gt;|&gt;|}||||&gt;{(}&gt;|&gt;|}(&gt;||}(&gt;|&gt;((}|[((((()))))|}||}})||}}||(){[)|(&lt;}|||}|(}&gt;}|&gt;((}|[(((()))))|}|}|)|}}||(){[)|(&lt;}|||}|(}&gt;}|&gt;((}|[((((()))))|}|}|})|)|}}||(){[)|(&lt;}|||}|(}&gt;}|{}&gt;(&lt;((}|[))||(&gt;|&gt;(&lt;(}&lt;{(}&gt;|&gt;|}||||&gt;{(}&gt;|&gt;|}|||}&gt;((}|[((((()))))|}|}|)|}}|}||(){[)|(&lt;}|||}|{}}(&lt;(&gt;}&gt;||||}(&gt;|&gt;(&lt;(}&lt;{(}&gt;|&gt;|}||||&gt;{(}&gt;|&gt;|}&gt;|}{(}&gt;|&gt;|&gt;


Try it online!

(Note that the above link does not run because TIO doesn't have a Compressed Brain-Flak interpreter. You can find a transpiler to Brain-Flak here)

I have checked that this is valid by transpiling to Brain-Flak using this tool, now efficient enough that timing out is unlikely.