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,CAEvB,SACA,OACA,SACA,QACA,UACA,qBACA,QACA,WACA,SACA,WACA,UACA,SACA,QACA,SACA,OACA,iBAEA,SACA,cACA,SACA,SAEA,iBACA,SACA,QACA,aAGA,aACA,gBACA,eACA,oBACA,oBACA,wBACA,qBACA,cACA,2BACA,wBACA,kBACA,wBACA,mBACA,2BACA,2BACA,0BACA,yBACA,wBACA,0BACA,2BACA,6BACA,6BACA,yBACA,sCACA,cACA,aACA,sBACA,sBACA,YACA,yBACA,gBACA,sBACA,iBACA,yBAEA,QACA,SACA,kBACA,qBACA,oBACA,gBACA,mBACA,kBAEA,UACA,MACA,oBACA,OACA,WACA,SACA,aACA,QACA,YACA,QACA,QACA,WACA,UACA,MACA,UACA,QACA,oBACA,qBACA,uBACA,QACA,SACA,OAEA,SAEA,eAyCOA,GAAAA,uBAjCsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,YACA,kBACA,cAcOA,GAAAA,yBANwB,CAAC,OAAQ,QAOjCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,MACnCA,GAAAA,kBAAoB1S,EAAO,GAAD,SAC5BZ,OAAOuH,OAjzBY,CAExBmM,KAAM,CACJ,kBACA,8BACA,qBACA,sBACA,eACA,oBACA,wBACA,sBACA,qBACA,sBAGFC,kBAAmB,CACjB,YACA,YACA,MACA,OACA,QACA,UACA,YACA,aACA,MACA,MACA,mBACA,aACA,cACA,aACA,MACA,UACA,YAGFC,UAAW,CACT,YACA,YACA,mBACA,MACA,UACA,SACA,UACA,QACA,UACA,cACA,aACA,MACA,MACA,aACA,OAGFC,qBAAsB,CACpB,wBACA,mBACA,mBACA,kBAGFC,MAAO,CACL,QACA,eACA,eACA,kBACA,iBACA,sBACA,2BACA,gBACA,SACA,cACA,UACA,gBAGFC,QAAS,CAAC,aAEVC,WAAY,CAAC,OAAQ,mBAAoB,gBAAiB,aAE1DC,KAAM,CACJ,eACA,UACA,OACA,WACA,WACA,YACA,aACA,sBACA,cACA,WACA,aACA,aAGFC,SAAU,CACR,mBACA,WACA,UACA,eACA,eACA,gBACA,iBACA,kBACA,WACA,kBAGFC,UAAW,CAAC,SAEZC,eAAgB,CAAC,kBAEjBC,UAAW,CACT,qBACA,qBACA,WACA,UACA,cACA,eACA,YACA,aACA,cACA,iBACA,YACA,yBACA,cACA,kBACA,kBACA,mBACA,cACA,gBACA,eACA,YACA,gBACA,eACA,cACA,cACA,UACA,aACA,cACA,YACA,YACA,kBACA,cACA,qBACA,kBACA,iBACA,eACA,0BACA,aACA,kBACA,mBACA,kBACA,gBACA,mBACA,kBACA,aACA,YACA,cACA,iBACA,yBACA,iBACA,aACA,mBACA,eACA,eACA,YACA,cACA,gBACA,gBACA,aACA,WACA,eACA,YACA,OACA,QAGFC,KAAM,CAAC,mBAAoB,MAAO,OAAQ,SAAU,UAEpDC,IAAK,CAAC,iBAAkB,kBAAmB,0BAA2B,qBAEtEC,SAAU,CAAC,gBAAiB,UAAW,eAAgB,gBAAiB,oBAExEC,KAAM,CACJ,eACA,aACA,sBACA,aACA,qBACA,mBACA,4BACA,mBACA,kBAGFC,KAAM,CACJ,MACA,OACA,SACA,SACA,cACA,OACA,OACA,MACA,QACA,MACA,KACA,MACA,QACA,WACA,QACA,MACA,cACA,gBACA,cACA,WACA,gBACA,MACA,QACA,QACA,OACA,UACA,QACA,MACA,OACA,OACA,QACA,MACA,OACA,OACA,QACA,MACA,OACA,OACA,QACA,QACA,gBAGFC,WAAY,CACV,cACA,aACA,YACA,OACA,MACA,kBACA,mBAGFC,IAAK,CACH,qBACA,0BACA,mBACA,kBACA,eACA,sBACA,oBACA,WACA,oBACA,kBAGFC,UAAW,CAAC,OAAQ,aAAc,eAAgB,YAAa,QAAS,cAExEC,SAAU,CAAC,gBAEXC,qBAAsB,CACpB,OACA,YACA,aACA,aACA,cACA,SACA,UACA,WACA,YAGF5T,OAAQ,CACN,QACA,cACA,cACA,mBACA,MACA,uBACA,wBACA,SACA,kBACA,YACA,SACA,cACA,cACA,WACA,UACA,QACA,OACA,SACA,OACA,QACA,QACA,YACA,yBACA,eACA,kBACA,iBACA,qBACA,eACA,iBACA,gBACA,UACA,SACA,UACA,QACA,OACA,QACA,+BACA,UACA,QACA,cACA,SACA,SACA,YACA,YACA,YACA,iBACA,SACA,YACA,OACA,UACA,SAGF6T,KAAM,CACJ,eACA,OACA,UACA,WACA,WACA,YACA,aACA,cACA,cAGFC,UAAW,CACT,oBACA,UACA,SACA,YACA,gBACA,gBACA,iBACA,kBACA,mBACA,kBACA,oBACA,mBACA,mBACA,eACA,cACA,eAGFC,KAAM,CAAC,iBAEPC,YAAa,CAAC,WAAY,KAAM,SAAU,UAE1CC,gBAAiB,CACf,MACA,UACA,SACA,UACA,OACA,QACA,YACA,aACA,uBACA,QACA,eACA,wBACA,OACA,MACA,MACA,OACA,MACA,YACA,SACA,aACA,cACA,MACA,MACA,SACA,WACA,UACA,YAEFC,cAAe,CAAC,aAChBC,cAAe,CAAC,UAAW,QAAS,OAAQ,QAAS,aAAc,UAAW,UAC9EC,iBAAkB,CAEhB,WACA,WACA,SACA,SACA,SACA,wBACA,QACA,OAEFC,eAAgB,CACd,eACA,eACA,oBACA,OACA,WACA,WACA,MACA,YACA,YACA,kBACA,OACA,SACA,QACA,oBACA,MACA,iBACA,UACA,mBACA,SACA,oBACA,OACA,YACA,oBACA,mBACA,oBACA,oBACA,kBACA,mBACA,oBACA,mBACA,mBACA,OACA,QAEFC,SAAU,CAAC,YAAa,WAAY,mBAAoB,mBACxDC,WAAY,CAAC,eAAgB,uBAC7BC,WAAY,CACV,MACA,OACA,QACA,OACA,QACA,OACA,QACA,QACA,OACA,MACA,OACA,UACA,MACA,QACA,KACA,MACA,OACA,QACA,KACA,MACA,UACA,OACA,QACA,MACA,OACA,OACA,MACA,QAEFC,YAAa,CAAC,eAAgB,iBAAkB,kBAChDC,aAAc,CACZ,SAEA,QACA,OACA,SACA,QACA,OACA,QACA,UACA,QACA,OACA,QACA,QACA,SACA,SAEFC,oBAAqB,CAAC,mBAAoB,0BAA2B,eACrEC,UAAW,CAAC,OAAQ,SAAU,OAC9BC,aAAc,CACZ,MACA,QACA,MACA,MACA,SACA,MACA,YACA,aACA,cACA,MACA,aACA,OACA,YACA,QACA,eACA,kBACA,kBACA,OACA,kBACA,cAEFC,WAAY,CACV,eACA,QACA,cACA,OACA,mBACA,KACA,WACA,OACA,OACA,aAEFC,MAAO,CAAC,iBAAkB,kCA+RYtU,QAAO,SAAC6I,EAAK5J,GAAN,kBAAkB4J,GAAlB,EAA0B5J,MAAM,KAD5C,EAE5Bb,OAAOuH,OAxRW,CACvB4O,SAAU,CACR,MAEA,MAEA,KACA,MACA,uBACA,KACA,UACA,KAEA,OACA,UACA,WAGA,OACA,UACA,UACA,SACA,OACA,WAGA,OACA,SAGA,SACA,UACA,QAEA,YACA,MAEA,OAEA,WACA,SACA,OAEA,KACA,SACA,KAIA,OACA,KAIA,OAEA,SAGA,MACA,KACA,MACA,OACA,QACA,KAKA,OACA,YACA,YACA,QACA,QACA,YACA,UAEA,SACA,OAGA,OAEA,QAEA,OACA,KACA,QACA,OACA,YAQA,UAEFC,UAAW,CACT,QACA,OACA,QACA,OACA,WACA,YACA,WACA,QACA,MACA,WACA,UACA,SACA,UACA,UACA,UACA,UACA,aACA,aACA,UACA,SACA,SACA,OACA,YAGFC,aAAc,CAAC,MAAO,QAAS,UAAW,QAAS,QAAS,QAC5DC,KAAM,CAAC,UA0J8B1U,QAAO,SAAC6I,EAAK5J,GAAN,kBAAkB4J,GAAlB,EAA0B5J,MAAM,OAGrEyS,GAAAA,YAAmC,CAAC,KAAM,KAAM,MAChDA,GAAAA,WAAa,CAAC,IAAK,QACnBA,GAAAA,SAAW,CAAC,IAAK,OACjBA,GAAAA,wBAA0B,CAAC,KAC3BA,GAAAA,sBAAwB,GACxBA,GAAAA,iBAAmB,CAAC,KAAM,KAC1BA,GAAAA,iBAAmB,CAAErL,IAAK,QAC1BqL,GAAAA,UAAY,CAAC,KAAM,KAAM,MC7zBlC,IAm1BqBiD,GAAAA,SAAAA,I,8xBAoBnB,WACE,OAAO,IAAI3P,EAAU,CACnB6B,iBAAkB8N,EAAa9N,iBAC/BC,uBAAwB6N,EAAa7N,uBACrCH,yBAA0BgO,EAAahO,yBACvCI,uBAAwB4N,EAAa5N,uBACrCH,yBAA0B+N,EAAa/N,yBACvCjD,iBAAkBgR,EAAahD,kBAC/B1N,YAAa0Q,EAAa1Q,YAC1BkD,WAAYwN,EAAaxN,WACzBC,SAAUuN,EAAavN,SACvBM,wBAAyBiN,EAAajN,wBACtCG,sBAAuB8M,EAAa9M,sBACpCrC,iBAAkBmP,EAAanP,iBAC/B5B,iBAAkB+Q,EAAa/Q,iBAC/BqD,UAAW0N,EAAa1N,iB,uEAnCT0N,CAAqBxI,G,ovDACjCwI,GAAAA,iBA7KgB,CACvB,kBACA,iBACA,iBACA,cACA,aACA,mBACA,kBACA,iBACA,iBACA,cACA,mBACA,gBACA,wBACA,aACA,qBACA,wBACA,OACA,QACA,UACA,SACA,UACA,eACA,yBACA,kBACA,kBACA,gCACA,eACA,wBACA,cACA,oBACA,mBACA,cACA,kBACA,kBACA,iBACA,eACA,oBACA,iBACA,yBACA,cACA,kBACA,cACA,iBACA,iCACA,oBACA,gBACA,mBACA,SACA,kBACA,iBACA,kBACA,qBACA,iBACA,OACA,sBACA,WACA,UACA,oBACA,UACA,QACA,eACA,kBACA,QACA,eACA,UACA,SACA,QACA,aACA,QACA,OACA,UACA,UACA,UACA,oBACA,SACA,SACA,WACA,YACA,SACA,cACA,iBACA,MACA,0BACA,wCACA,0CACA,yBACA,qCACA,qBACA,2BACA,gCACA,8BACA,sDACA,gCACA,2BACA,yBACA,wBACA,iCACA,6CACA,0BACA,8BACA,oBACA,oBACA,qCACA,mCACA,0BACA,WACA,aACA,wBACA,SACA,WACA,SACA,SACA,cACA,WAEA,MACA,eACA,QACA,aACA,cACA,OACA,WACA,KACA,SACA,cACA,QACA,SACA,WACA,SACA,qBACA,QACA,QA0COA,GAAAA,uBAlCsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,YACA,kBACA,aACA,gBAcOA,GAAAA,yBANwB,CAAC,OAAQ,OAAQ,UAOzCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,MACnCA,GAAAA,kBAAoB3V,EAAO,GAAD,UAC5BZ,OAAOuH,OA11BY,CAExBqM,UAAW,CACT,YACA,MACA,OACA,cACA,QACA,YACA,YACA,aACA,QACA,aACA,kBACA,YACA,WACA,UACA,MACA,SACA,MACA,kBACA,kBACA,eACA,YACA,YACA,aACA,iBACA,YACA,UACA,aACA,WACA,WACA,WACA,aACA,SACA,cACA,MACA,UACA,WACA,MACA,WACA,gBACA,UAGF4C,OAAQ,CACN,MACA,SACA,OACA,WACA,aACA,eACA,cACA,aACA,aACA,cACA,aACA,QACA,YACA,YACA,WACA,OACA,OACA,QACA,QACA,SACA,SACA,SACA,YACA,QACA,SACA,SACA,OACA,QACA,cACA,iBACA,UACA,OACA,OACA,QACA,mBACA,cACA,MACA,OACA,WACA,gBACA,mBACA,SACA,WACA,MACA,OACA,OACA,MACA,aACA,YACA,gBACA,YACA,OACA,eACA,SACA,WACA,kBACA,mBACA,UACA,MACA,SACA,iBACA,cACA,eACA,aACA,yBACA,sBACA,uBACA,yBACA,0BACA,0BACA,0BACA,6BACA,UACA,aACA,SACA,mBACA,SACA,kBACA,aACA,aACA,kBACA,eACA,MACA,UACA,QACA,QACA,kBACA,yBACA,UACA,cACA,UACA,WACA,OACA,aACA,WACA,YACA,cACA,MACA,OACA,qBACA,SACA,SACA,QACA,UACA,MACA,aACA,WACA,QACA,QACA,OACA,SACA,KACA,SACA,mBACA,QACA,QACA,OACA,QACA,MACA,kBACA,cACA,mBACA,MACA,SACA,MACA,QACA,iBACA,SACA,aACA,YACA,gBACA,SACA,eACA,WACA,aACA,qBACA,mBACA,SACA,MACA,UACA,OACA,WACA,SACA,QACA,MACA,WACA,UACA,UACA,cACA,SACA,OACA,OACA,eACA,eACA,cACA,iBACA,gBACA,SACA,UACA,MACA,QACA,QACA,kBACA,QACA,OACA,QACA,QACA,SACA,OACA,MACA,OACA,WACA,UACA,YACA,YACA,aACA,aACA,QACA,OACA,QACA,UACA,SACA,WACA,SACA,YACA,MACA,OACA,OACA,YACA,eACA,gBACA,mBACA,gBACA,eACA,UACA,UACA,UACA,YACA,aACA,eACA,YACA,OACA,aACA,WACA,QACA,kBACA,QACA,UACA,cACA,SACA,QACA,QACA,YACA,UACA,WACA,qBACA,iBACA,aACA,wBACA,uBACA,uCACA,OACA,WACA,OACA,gBACA,aACA,YACA,cACA,aACA,YACA,YACA,gBACA,WACA,QACA,WACA,eACA,UACA,iBACA,eACA,QAGFC,MAAO,CACL,kBACA,oBACA,oBACA,mBACA,YACA,gBACA,eACA,mBACA,YAGFC,IAAK,CAAC,UAENC,KAAM,CAAC,cAAe,MAAO,aAAc,OAAQ,YAAa,QAAS,qBA4iBnC/U,QAAO,SAAC6I,EAAK5J,GAAN,mBAAkB4J,GAAlB,GAA0B5J,MAAM,KAD5C,GAE5Bb,OAAOuH,OAriBW,CAEvBqP,SAAU,CACR,MACA,WACA,QACA,WACA,MACA,KACA,QACA,eACA,aACA,YACA,UACA,KACA,QACA,MACA,YACA,SACA,QACA,UACA,aACA,KACA,UACA,WACA,OACA,OACA,QACA,YACA,QACA,QACA,UACA,aACA,SACA,SACA,YACA,aACA,aACA,UACA,WACA,SACA,OACA,UACA,eACA,mBACA,eACA,iBACA,eACA,oBACA,UACA,SACA,OACA,WACA,SACA,UACA,UACA,aACA,gBACA,UACA,WACA,WACA,KACA,WACA,SACA,UACA,WACA,WACA,aACA,SACA,WACA,QACA,SACA,YACA,SACA,OACA,WACA,SACA,YACA,QACA,QACA,MACA,OACA,OACA,WACA,YACA,MACA,SACA,OACA,QACA,UACA,OACA,QACA,KACA,YACA,KACA,YACA,QACA,UACA,QACA,QACA,cACA,OACA,KACA,SACA,UACA,MACA,OACA,MACA,WACA,OACA,WACA,QACA,OACA,QACA,SACA,UACA,WACA,OACA,UACA,WACA,OACA,OACA,aACA,eACA,eACA,gBACA,WACA,SACA,OACA,UACA,KACA,OACA,MACA,OACA,QACA,WACA,OACA,KACA,MACA,YACA,YACA,eACA,WACA,QACA,eACA,MACA,QACA,UACA,YACA,OACA,SACA,YACA,cACA,eACA,OACA,YACA,SACA,OACA,YACA,UACA,QACA,SACA,aACA,YACA,UACA,OACA,SACA,QACA,UACA,QACA,aACA,WACA,WACA,SACA,qBACA,SACA,UACA,OACA,SACA,gBACA,aACA,cACA,kBACA,kBACA,gBACA,WACA,MACA,SACA,SACA,aACA,UACA,SACA,WACA,WACA,YACA,eACA,SACA,OACA,SACA,WACA,WACA,SACA,YACA,OACA,WACA,SACA,QACA,UACA,UACA,UACA,SACA,eACA,QACA,aACA,OACA,KACA,UACA,OACA,OACA,SACA,QACA,OACA,YACA,WACA,UACA,OACA,aACA,OACA,WACA,UACA,QACA,MACA,YACA,UACA,QACA,QAGFC,cAAe,CACb,gBACA,UACA,WACA,aACA,cACA,YACA,OACA,aACA,WACA,WACA,UACA,OACA,YACA,kBACA,oBACA,UACA,UACA,gBACA,UACA,cACA,mBACA,SACA,SACA,iBACA,WACA,WACA,WACA,UAGFC,SAAU,CACR,QACA,kBACA,mBACA,wBACA,gBACA,cACA,eACA,YACA,aACA,eACA,OACA,SACA,gBACA,SACA,gBACA,kBACA,mBACA,qBACA,mBACA,cACA,4BACA,gBACA,0BACA,mBACA,cACA,oBACA,kBACA,iBACA,kBACA,iBACA,gBACA,kBACA,MACA,OACA,MACA,eACA,YACA,aACA,eACA,gCACA,6BACA,aACA,wBACA,uBACA,wBACA,sBACA,yBACA,eACA,iBACA,cACA,yBACA,eACA,kBACA,oBACA,oBACA,kBACA,gBACA,MACA,cACA,UACA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aACA,YACA,kBACA,aACA,mBACA,YACA,kBACA,cAcOA,GAAAA,yBANwB,CAAC,OAAQ,QAOjCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,MACnCA,GAAAA,kBAAoBnW,EAAO,GAAD,UAC5BZ,OAAOuH,OAnmBY,CACxBmN,KAAM,CACJ,MACA,OACA,OACA,OACA,MACA,SACA,OACA,OACA,UACA,OACA,MACA,UAEA,MACA,YACA,QACA,WACA,MACA,QACA,KACA,MACA,QACA,OACA,WACA,KACA,OACA,WACA,MACA,QACA,UACA,OACA,QACA,YACA,aACA,qBACA,OACA,MACA,OACA,MACA,QACA,gBAEFZ,MAAO,CAAC,iBAAkB,WAAY,aAAc,OAAQ,cAC5DE,WAAY,CAAC,SAAU,QACvBC,KAAM,CACJ,aACA,OACA,WACA,cACA,WACA,WACA,MACA,UACA,aACA,YACA,UACA,gBACA,qBACA,OACA,WACA,SACA,QACA,iBACA,WACA,UACA,SACA,YACA,UACA,mBACA,QACA,iBACA,aACA,QAEFkB,YAAa,CAAC,cAAe,WAAY,KAAM,YAAa,SAAU,SAAU,OAChFhU,OAAQ,CACN,QACA,SACA,mBACA,MACA,SACA,YACA,iBACA,SACA,MACA,SACA,QACA,cACA,gBACA,kBACA,UACA,UACA,QACA,QACA,SACA,cACA,SACA,QACA,OACA,QACA,SACA,eACA,YACA,SACA,QACA,iBACA,iBACA,SACA,UACA,OACA,QACA,YACA,UACA,QACA,QACA,aACA,SACA,YACA,YACA,OACA,QACA,WACA,SAEF6V,QAAS,CACP,OACA,eACA,YACA,cACA,oBACA,oBAEFV,KAAM,CACJ,cACA,cACA,QACA,mBACA,eACA,OACA,cACA,iBACA,MACA,UACA,MACA,OACA,OACA,gBACA,WAEF1C,UAAW,CACT,MACA,eACA,cACA,OACA,QACA,YACA,aACA,oBACA,MACA,MACA,QACA,aACA,oBACA,YACA,YACA,aACA,iBACA,UACA,aACA,WACA,WACA,WACA,aACA,cACA,MACA,UACA,WACA,YAEF6C,MAAO,CAAC,UAAW,SAAU,aAAc,kBAAmB,aAAc,WA8atC7U,QAAO,SAAC6I,EAAK5J,GAAN,mBAAkB4J,GAAlB,GAA0B5J,MAAM,KAD5C,GAE5Bb,OAAOuH,OAtaW,CAEvB0P,YAAa,CACX,MACA,QACA,QACA,UACA,UACA,MACA,SACA,SACA,UACA,UACA,SACA,UACA,YACA,gBACA,aACA,UACA,UACA,UACA,cACA,UACA,cACA,WACA,OACA,YACA,WACA,MACA,eACA,WACA,UACA,YACA,aACA,OACA,cACA,YACA,UACA,aACA,YACA,SACA,UACA,YACA,UACA,SACA,SACA,OACA,aACA,QACA,SACA,YACA,YACA,eACA,OACA,gBACA,SACA,QACA,UACA,SACA,cACA,cACA,QACA,MACA,OACA,WACA,QACA,QACA,OACA,WACA,OACA,QACA,UACA,OACA,UACA,eACA,WACA,QACA,SACA,QACA,OACA,SACA,UACA,UACA,SACA,eACA,eACA,YACA,QACA,cACA,aACA,OACA,SACA,aACA,aACA,QACA,OACA,WACA,UACA,eACA,eACA,SACA,SACA,SACA,UACA,cACA,WACA,UACA,OACA,QACA,SACA,UACA,SACA,OACA,QACA,kBACA,SACA,OACA,SACA,OACA,gBACA,SACA,OACA,SACA,MACA,aACA,SACA,cACA,SACA,SACA,SACA,gBACA,YACA,aACA,UACA,QACA,eACA,YACA,OACA,YACA,SACA,QACA,WACA,MAEA,MACA,eACA,aACA,OACA,QACA,OACA,aACA,YACA,QACA,SACA,WACA,cACA,OACA,QACA,QACA,MACA,OACA,SACA,aACA,QACA,OACA,WACA,SACA,MACA,aACA,WACA,UACA,UACA,gBACA,OACA,QACA,SACA,QACA,OACA,QACA,UACA,UACA,cACA,QAEFC,SAAU,CAER,MAGA,QACA,KACA,gBACA,UACA,SACA,SACA,UACA,OACA,KAEA,OACA,OACA,SACA,OAEA,QACA,OACA,UACA,eACA,oBACA,SACA,WACA,OACA,UACA,SAEA,WACA,SAIA,WACA,SACA,WACA,WACA,QAEA,Q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,EAAiB5R,iBACnCqD,UAAWuO,EAAiBvO,c,2BAIhC,SAAc9F,GAEZ,OAAIG,EAAQgB,IAAInB,IAA0C,MAAhCV,KAAKkL,iBAAiB5M,MAEvC,CAAE+B,KAAMV,EAAUoB,iBAAkBzC,MAAOoC,EAAMpC,OAGnDoC,O,uEA1CUqU,CAAyBrJ,G,+/BACrCqJ,GAAAA,iBAvQgB,CACvB,iBACA,yBACA,cACA,iBACA,kBACA,eACA,uBACA,iBACA,eACA,cACA,aACA,aACA,UACA,gBACA,cACA,eACA,gBACA,QACA,SACA,cACA,OACA,mBACA,cACA,aACA,iBACA,SACA,4BACA,kBACA,eACA,kBACA,eACA,mBACA,cACA,kBACA,gBACA,uBACA,eACA,iBACA,sBACA,cACA,cACA,qBACA,SACA,OACA,WACA,KACA,gBACA,aACA,gBACA,aACA,eACA,iBACA,YACA,gBACA,cACA,aACA,eACA,YACA,YACA,UACA,UACA,QACA,kBACA,4BACA,QACA,UACA,OACA,SACA,iBACA,iBACA,OACA,mBACA,wBACA,kBACA,aACA,iBACA,UACA,oBACA,oBACA,oBACA,eACA,cACA,eACA,cACA,UACA,eACA,oBACA,gBACA,cACA,WACA,YACA,SACA,WACA,YACA,SACA,MACA,oBACA,mBACA,yBACA,YACA,eACA,WACA,gBACA,kBACA,OACA,2BACA,yBACA,eACA,mBACA,qBACA,qBACA,qBACA,yBACA,iBACA,eACA,oBACA,uBACA,oBACA,uBACA,sBACA,2BACA,wBACA,uBACA,oBACA,sBACA,mBACA,mBACA,iBACA,cACA,4BACA,eACA,cACA,cACA,eACA,qBACA,uBACA,cACA,aACA,eACA,wBACA,YACA,eACA,mBACA,qBACA,mBACA,yBACA,2BACA,sBACA,eACA,sBACA,kBACA,sBACA,wBACA,mBACA,eACA,gBACA,2BACA,uBACA,eACA,qBACA,sBACA,eACA,aACA,mBACA,oBACA,cACA,uBACA,oBACA,cACA,gBACA,uBACA,iBACA,gBACA,wBACA,oBACA,WACA,SACA,qBACA,mBACA,gBACA,cACA,oBACA,oBACA,kBACA,eACA,aACA,WACA,iBACA,mBACA,mBACA,eACA,SACA,MACA,OACA,WACA,YACA,SACA,aACA,aACA,cACA,WAEA,MACA,eACA,OACA,WACA,SACA,cACA,SACA,QACA,SACA,WACA,SACA,SACA,SAiDOA,GAAAA,uBAzCsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBACA,QACA,YACA,iBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,aACA,eAEA,gBACA,oBACA,0BACA,qBACA,4BAcOA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,KAAM,OACzCA,GAAAA,yBARwB,CAAC,OAAQ,OAAQ,SAAU,SASnDA,GAAAA,iBAAmBxW,EAAO,GAAD,OA34BT,CACvB,aACA,UACA,SACA,QACA,QACA,UACA,YACA,MACA,YACA,QACA,SACA,MACA,KACA,MACA,QACA,aACA,KACA,SACA,UACA,iBACA,kBACA,OACA,MACA,iBACA,SACA,SACA,UACA,SACA,SACA,MACA,OACA,QACA,OACA,OACA,UACA,OACA,QACA,KACA,OACA,QACA,UACA,WACA,eACA,QACA,SACA,UACA,OACA,YACA,gBACA,UACA,QACA,aACA,WACA,SACA,eACA,SACA,OACA,QACA,WACA,OACA,UACA,YACA,SACA,cACA,UACA,aACA,gBACA,gBACA,aACA,UACA,YACA,UACA,aACA,aACA,aACA,YACA,aACA,aACA,aACA,qBACA,kBACA,oBACA,WACA,UACA,WACA,eACA,UACA,MACA,SACA,QACA,OACA,UACA,eACA,cACA,eACA,eACA,oBACA,eACA,SACA,cACA,QACA,OACA,WACA,YACA,WACA,OACA,WACA,MACA,WACA,kBACA,aACA,aACA,aACA,MACA,UACA,UACA,UACA,UACA,UACA,kBACA,mBACA,eACA,gBACA,cACA,YACA,UACA,UACA,OACA,WACA,cACA,MACA,SACA,gBACA,OACA,OACA,WACA,YACA,UACA,OACA,QACA,SACA,WACA,OACA,SACA,UACA,OACA,QACA,SACA,SACA,UACA,QACA,SACA,QACA,WACA,WACA,UACA,YACA,SACA,OACA,YACA,SACA,SACA,WACA,cACA,QACA,OACA,SACA,YACA,QACA,SACA,OACA,QACA,QACA,QACA,SACA,SACA,YACA,UACA,MACA,QACA,UACA,QACA,OACA,WACA,WACA,UACA,YACA,aACA,MACA,SACA,OACA,SACA,QACA,OACA,OACA,gBACA,UACA,OACA,QACA,OACA,mBACA,cACA,cAEA,aACA,KACA,SACA,UACA,oBACA,oBACA,YACA,SACA,KACA,YACA,QACA,UACA,SACA,eACA,QACA,QACA,cACA,gBACA,UACA,MACA,OACA,OACA,OACA,OACA,OACA,UACA,WACA,YACA,OACA,KACA,YACA,MACA,KACA,YACA,SACA,SACA,UACA,UACA,OACA,aACA,MACA,OACA,iBACA,WACA,OACA,aACA,UACA,UACA,QACA,SACA,OACA,OACA,QACA,OACA,SACA,QACA,OACA,OACA,QACA,YACA,iBACA,OACA,SACA,QACA,UACA,OACA,OACA,WACA,WACA,OACA,eACA,SACA,uBACA,eACA,kBACA,cACA,kBACA,iBACA,kBACA,cACA,mBACA,aACA,gBACA,oBACA,kBACA,oBACA,iBACA,qBACA,iBACA,gCACA,cACA,kBACA,0BACA,QACA,2BACA,uBACA,WACA,WACA,qBACA,uBACA,uBACA,WACA,SACA,aACA,YACA,aACA,SACA,QACA,eACA,cACA,YACA,UACA,QACA,SACA,qBACA,gBACA,WACA,WACA,MACA,OACA,WACA,SACA,UACA,QACA,QACA,QACA,cACA,OACA,QACA,WACA,UACA,QACA,SACA,QACA,MACA,OACA,UACA,KACA,aACA,aACA,UACA,UACA,UACA,SACA,YACA,OACA,MACA,WACA,qBACA,OACA,SACA,UACA,WACA,KACA,SACA,eACA,YACA,YACA,MACA,SACA,OACA,OACA,WACA,UACA,SACA,aACA,QACA,aACA,SACA,MACA,QACA,UACA,OACA,WACA,QACA,UACA,YACA,OACA,gBACA,SACA,kBACA,OACA,SACA,UACA,YACA,eACA,aACA,WACA,aACA,QACA,SACA,UACA,OACA,UACA,WACA,YACA,YACA,WACA,OACA,WACA,UACA,aACA,YACA,UACA,cACA,UACA,WACA,QACA,QACA,UACA,QACA,QACA,QACA,QACA,MACA,OACA,YACA,aACA,QACA,OACA,UACA,UACA,YACA,mBACA,WACA,YACA,aACA,SACA,QACA,WACA,iBACA,gBACA,eACA,UACA,SACA,SACA,SACA,aACA,SACA,aACA,SACA,UACA,WACA,cACA,cACA,SACA,UACA,QACA,UACA,UACA,WACA,SACA,oBACA,SACA,UACA,QACA,QACA,QACA,OACA,SACA,UACA,MACA,WACA,SACA,OACA,UACA,YACA,aACA,QACA,WACA,SACA,cACA,UACA,SACA,qBACA,WACA,YACA,YACA,WACA,SACA,eACA,UACA,SACA,SACA,QACA,SACA,SACA,OACA,QACA,SACA,YACA,OACA,WACA,WACA,SACA,OACA,OACA,SACA,SACA,SACA,QACA,SACA,UACA,WACA,gBACA,MACA,eACA,WACA,aACA,iBACA,oBACA,YACA,sBACA,eACA,mBACA,aACA,iBACA,iBACA,eACA,cACA,eACA,gBACA,kBACA,eACA,MACA,QACA,WACA,SACA,YACA,oBACA,mBACA,qBACA,SACA,OACA,UACA,SACA,kBACA,UACA,eACA,gBACA,QACA,UACA,QACA,WACA,UACA,SACA,cACA,QACA,aACA,SACA,aACA,iBACA,YACA,YACA,aACA,OACA,OACA,OACA,OACA,OACA,YACA,eACA,gBACA,WACA,UACA,WACA,KACA,WACA,cACA,gBACA,UACA,UACA,WACA,OACA,OACA,QACA,YACA,cACA,YACA,mBACA,WACA,OACA,UACA,SACA,UACA,SACA,YACA,WACA,QACA,UACA,QACA,OACA,iBACA,UACA,WACA,WACA,gBACA,QACA,YACA,UACA,eACA,WACA,YACA,UACA,MACA,OACA,UACA,UACA,aACA,OACA,WACA,OACA,gBACA,QACA,SACA,SACA,UACA,OACA,UACA,QACA,OACA,KACA,MACA,OACA,aACA,YAz2BwB,CACxB,UACA,aACA,UACA,SACA,UACA,OACA,QACA,YACA,UACA,UACA,WACA,WACA,cACA,SACA,aACA,UACA,cACA,eACA,gBACA,iBACA,MACA,OACA,MACA,SACA,MACA,MACA,MACA,YACA,QACA,WACA,eACA,kBACA,kBACA,OACA,aACA,eACA,MACA,SACA,aACA,cACA,UACA,SACA,YACA,MACA,cACA,OACA,cACA,WACA,UACA,WACA,MACA,OACA,UACA,cACA,cACA,OACA,OACA,QACA,YACA,MACA,kBACA,YACA,aACA,OACA,UACA,mBACA,cACA,MACA,eACA,eACA,gBACA,cACA,cACA,WACA,SACA,yBACA,YACA,gBACA,OACA,aACA,MACA,MACA,QACA,WACA,UACA,aACA,YACA,YACA,UACA,mBACA,gBACA,cACA,cACA,MACA,SACA,UACA,MACA,aACA,eACA,QACA,cACA,QACA,SACA,aACA,cACA,YACA,gBACA,WACA,WACA,MACA,SACA,QACA,SACA,eACA,eACA,aACA,oBACA,oBACA,eACA,gBACA,qBACA,aACA,gBACA,cACA,eACA,cACA,YACA,cACA,aACA,aACA,mBACA,sBACA,aACA,aACA,cACA,cACA,eACA,WACA,cACA,YACA,eACA,aACA,aACA,WACA,iBACA,QACA,QACA,SACA,UACA,KACA,YACA,SACA,MACA,QACA,OACA,QACA,OACA,cACA,QACA,eACA,WACA,WACA,WACA,mBACA,kBACA,MACA,YACA,aACA,MACA,OACA,SACA,MACA,eACA,MACA,aACA,cACA,KACA,MACA,QACA,QACA,eACA,iBACA,gBACA,UACA,OACA,oBACA,eACA,iBACA,UACA,QACA,OACA,cACA,QACA,eACA,cACA,MACA,OACA,OACA,OACA,MACA,QACA,UACA,QACA,OACA,SACA,cACA,gBACA,kBACA,UACA,WACA,MACA,WACA,cACA,cACA,YACA,UACA,UACA,aACA,QACA,aACA,sBACA,QACA,iBACA,YACA,QACA,OACA,aACA,UACA,UACA,aACA,0BACA,uBACA,4BACA,cAq5BOwW,GAAAA,YAAmC,CAAC,KAAM,KAAM,MAChDA,GAAAA,WAAa,CAAC,IAAK,QACnBA,GAAAA,SAAW,CAAC,IAAK,OACjBA,GAAAA,wBAA0B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kBACA,iBACA,UACA,oBACA,oBACA,eACA,cACA,eACA,UACA,QACA,eACA,gBACA,gBACA,cACA,UACA,SACA,WACA,wBACA,YACA,SACA,MACA,oBACA,mBACA,YACA,eACA,qBACA,WACA,kBACA,OACA,mBACA,qBACA,qBACA,iBACA,eACA,uBACA,oBACA,uBACA,wBACA,oBACA,sBACA,mBACA,mBACA,iBACA,cACA,eACA,cACA,cACA,qBACA,uBACA,cACA,aACA,qBACA,mBACA,eACA,kBACA,sBACA,wBACA,mBACA,eACA,gBACA,uBACA,sBACA,gBACA,aACA,mBACA,cACA,oBACA,cACA,gBACA,iBACA,gBACA,WACA,kBACA,0BACA,gBACA,cACA,oBACA,yBACA,eACA,aACA,QACA,iBACA,sBACA,mBACA,kBACA,gBACA,SACA,MACA,SACA,OACA,KAGA,UACA,QACA,OACA,SACA,SACA,QAEA,MACA,eACA,OACA,WACA,SACA,cACA,QACA,SACA,WACA,SA8COA,GAAAA,uBAtCsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,aACA,eAEA,gBACA,oBACA,0BACA,qBACA,4BAcOA,GAAAA,yBANwB,CAAC,OAAQ,OAAQ,UAOzCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,KAAM,OACzCA,GAAAA,iBAAmBzW,EAAO,GAAD,OAl3BT,CACvB,aACA,UACA,SACA,SACA,QACA,QACA,UACA,YACA,YACA,MACA,QACA,SACA,UACA,UACA,MACA,QACA,KACA,MACA,aACA,KACA,YACA,iBACA,kBACA,iBACA,iBACA,SACA,SACA,QACA,UACA,SACA,MACA,OACA,QACA,OACA,UACA,OACA,QACA,UACA,KACA,OACA,QACA,UACA,WACA,eACA,QACA,qBACA,SACA,UACA,UACA,YACA,gBACA,QACA,WACA,SACA,eACA,SACA,QACA,OACA,UACA,SACA,UACA,gBACA,cACA,UACA,YACA,UACA,aACA,YACA,aACA,cACA,aACA,YACA,aACA,aACA,aACA,qBACA,kBACA,oBACA,WACA,UACA,WACA,MACA,SACA,QACA,OACA,UACA,SACA,cACA,OACA,YACA,WACA,WACA,WACA,kBACA,aACA,aACA,aACA,MACA,UACA,UACA,eACA,UACA,aACA,UACA,kBACA,OACA,cACA,eACA,gBACA,cACA,YACA,UACA,UACA,OACA,WACA,cACA,SACA,OACA,OACA,WACA,YACA,UACA,OACA,QACA,SACA,WACA,aACA,OACA,WACA,SACA,UACA,mBACA,OACA,QACA,SACA,SACA,UACA,QACA,SACA,QACA,WACA,UACA,SACA,OACA,YACA,SACA,SACA,WACA,cACA,SACA,wBACA,QACA,OACA,SACA,QACA,SACA,OACA,kBACA,SACA,SACA,QACA,QACA,QACA,SACA,SACA,YACA,UACA,MACA,QACA,UACA,QACA,OACA,WACA,WACA,UACA,YACA,iBACA,WACA,qBACA,MACA,wBACA,wBACA,SACA,WACA,SACA,QACA,SACA,oBACA,YACA,OACA,gBACA,YACA,UACA,OACA,QACA,mBACA,cACA,cACA,aACA,SACA,oBACA,SACA,WACA,QACA,UACA,SACA,UACA,eACA,WACA,QACA,QACA,cACA,gBACA,UACA,WACA,MACA,OACA,OACA,OACA,OACA,OACA,UACA,OACA,YACA,UACA,KACA,iBACA,kBACA,YACA,MACA,YACA,SACA,UACA,OACA,MACA,UACA,OACA,iBACA,WACA,OACA,UACA,UACA,QACA,SACA,OACA,QACA,SACA,QACA,aACA,OACA,OACA,QACA,OACA,SACA,QACA,UACA,OACA,OACA,WACA,WACA,OACA,eACA,SACA,uBACA,cACA,gCACA,uBACA,eACA,0BACA,cACA,kBACA,iBACA,kBACA,cACA,yBACA,qBACA,mBACA,aACA,gBACA,oBACA,kBACA,oBACA,iBACA,qBACA,iBACA,gCACA,0BACA,qBACA,cACA,gCACA,WACA,2BACA,uBACA,WACA,WACA,uBACA,uBACA,SACA,aACA,YACA,aACA,SACA,SACA,QACA,eACA,YACA,UACA,qBACA,gBACA,WACA,OACA,WACA,SACA,kBACA,aACA,eACA,QACA,cACA,OACA,QACA,WACA,UACA,QACA,MACA,aACA,SACA,oBACA,QACA,MACA,OACA,KACA,YACA,OACA,SACA,UACA,qBACA,OACA,QACA,SACA,UACA,WACA,KACA,MACA,SACA,KACA,MACA,YACA,YACA,MACA,OACA,OACA,WACA,kBACA,SACA,WACA,aACA,UACA,QACA,aACA,eACA,SACA,MACA,QACA,UACA,OACA,QACA,YACA,OACA,SACA,kBACA,UACA,YACA,eACA,aACA,WACA,qBACA,OACA,UACA,YACA,eACA,iBACA,QACA,SACA,UACA,aACA,QACA,UACA,OACA,WACA,YACA,YACA,WACA,OACA,UACA,aACA,wBACA,YACA,UACA,cACA,UACA,WACA,QACA,QACA,QACA,QACA,SACA,QACA,OACA,QACA,YACA,aACA,OACA,UACA,UACA,YACA,WACA,mBACA,YACA,YACA,aACA,eACA,QACA,WACA,iBACA,gBACA,eACA,UACA,SACA,SACA,SACA,SACA,aACA,SACA,aACA,UACA,WACA,kBACA,qBACA,sBACA,yBACA,uBACA,0BACA,8BACA,cACA,UACA,qBACA,WACA,WACA,UACA,UACA,WACA,SACA,SACA,SACA,oBACA,YACA,UACA,QACA,OACA,SACA,SACA,UACA,MACA,OACA,aACA,QACA,WACA,UACA,cACA,YACA,mBACA,6BACA,iBACA,mBACA,qBACA,WACA,YACA,YACA,SACA,eACA,SACA,UACA,YACA,QACA,SACA,SACA,SACA,OACA,QACA,OACA,WACA,WACA,SACA,OACA,SACA,SACA,SACA,uBACA,cACA,gCACA,uBACA,eACA,0BACA,cACA,kBACA,iBACA,kBACA,cACA,yBACA,qBACA,aACA,gBACA,oBACA,kBACA,oBACA,iBACA,qBACA,iBACA,gCACA,0BACA,qBACA,cACA,gCACA,UACA,WACA,MACA,eACA,WACA,aACA,kBACA,qBACA,mBACA,iBACA,oBACA,YACA,sBACA,eACA,mBACA,aACA,cACA,eACA,iBACA,gBACA,kBACA,iBACA,eACA,eACA,OACA,MACA,UACA,QACA,WACA,SACA,oBACA,mBACA,qBACA,SACA,OACA,UACA,SACA,SACA,SACA,kBACA,UACA,eACA,gBACA,QACA,UACA,QACA,WACA,SACA,SACA,aACA,iBACA,aACA,YACA,YACA,aACA,OACA,OACA,OACA,kBACA,OACA,WACA,UACA,WACA,MACA,KACA,WACA,cACA,UACA,WACA,OACA,OACA,QACA,YACA,cACA,YACA,OACA,WACA,mBACA,UACA,YACA,SACA,UACA,SACA,aACA,WACA,QACA,UACA,QACA,iBACA,UACA,aACA,QACA,YACA,UACA,eACA,YACA,UACA,OACA,OACA,UACA,UACA,OACA,WACA,QACA,SACA,UACA,OACA,UACA,QACA,OACA,MACA,MACA,aACA,WACA,QA7iCwB,CACxB,MACA,OACA,UACA,UACA,cACA,cACA,MACA,YACA,QACA,OACA,OACA,QACA,MACA,YACA,MACA,cACA,SACA,UACA,YACA,aACA,SACA,UACA,oBACA,sBACA,mBACA,kBACA,kBACA,OACA,OACA,OACA,UACA,OACA,cACA,mBACA,UACA,WACA,eACA,YACA,WACA,SACA,YACA,gBACA,OACA,UACA,aACA,MACA,MACA,QACA,QACA,YACA,UACA,eACA,eACA,eACA,oBACA,eACA,UACA,WACA,OACA,WACA,cACA,WACA,WACA,MACA,UACA,aACA,YACA,YACA,UACA,UACA,aACA,MACA,MACA,MACA,aACA,UACA,eACA,QACA,cACA,cACA,QACA,SACA,eACA,mBACA,aACA,cACA,YACA,gBACA,iBACA,qBACA,2BACA,wBACA,+BACA,aACA,WACA,WACA,eACA,WACA,cACA,gBACA,MACA,OACA,cACA,KACA,SACA,KACA,YACA,YACA,aACA,aACA,SACA,QACA,0BACA,0BACA,sBACA,oBACA,qBACA,uBACA,0BACA,gCACA,iCACA,wBACA,wBACA,qCACA,oCACA,wBACA,2BACA,6BACA,yBACA,2BACA,sBACA,uBACA,WACA,KACA,eACA,UACA,iBACA,iBACA,UACA,SACA,cACA,UACA,eACA,UACA,SACA,aACA,oBACA,oBACA,gBACA,gBACA,qBACA,aACA,eACA,cACA,YACA,cACA,aACA,mBACA,sBACA,cACA,iBACA,gBACA,cACA,aACA,cACA,eACA,oBACA,gCACA,cACA,WACA,oBACA,oBACA,aACA,YACA,eACA,aACA,aACA,MACA,WACA,iBACA,aACA,QACA,OACA,QACA,OACA,SACA,OACA,aACA,KACA,YACA,YACA,iBACA,SACA,MACA,QACA,OACA,QACA,OACA,QACA,WACA,WACA,WACA,kBACA,QACA,MACA,cACA,eACA,YACA,cACA,YACA,gBACA,cACA,aACA,YACA,MACA,YACA,cACA,MACA,MACA,SACA,MACA,QACA,YACA,kBACA,aACA,eACA,aACA,MACA,SACA,WACA,aACA,MACA,YACA,QACA,SACA,MACA,eACA,KACA,MACA,eACA,aACA,cACA,KACA,QACA,UACA,WACA,MACA,QACA,uBACA,eACA,UACA,QACA,UACA,OACA,eACA,OACA,SACA,eACA,cACA,iBACA,gBACA,oBACA,eACA,SACA,UACA,UACA,QACA,QACA,gBACA,QACA,YACA,aACA,OACA,QACA,SACA,cACA,SACA,eACA,OACA,OACA,OACA,MACA,QACA,UACA,cACA,kBACA,QACA,OACA,UACA,cACA,eACA,YACA,YACA,qBACA,cACA,aACA,cACA,gBACA,aACA,gBACA,eACA,cACA,cACA,qBACA,cACA,cACA,YACA,kBACA,qBACA,aACA,sBACA,qBACA,eACA,kBACA,qBACA,kBACA,iBACA,uBACA,mBACA,kBACA,gBACA,cACA,aACA,cACA,aACA,oBACA,cACA,YACA,kBACA,iBACA,0BACA,2BACA,qBACA,eACA,kBACA,mBACA,kBACA,oBACA,mBACA,mBACA,kBACA,mBACA,qBACA,eACA,cACA,qBACA,sBACA,mBACA,kBACA,YACA,kBACA,iBACA,cACA,UACA,gBACA,YACA,mBACA,aACA,eACA,WACA,cACA,YACA,OACA,OACA,mBACA,wBACA,MACA,SACA,aACA,cACA,cACA,SACA,UACA,SACA,YACA,kBACA,UACA,MACA,UACA,cACA,MACA,OACA,cACA,cACA,WACA,YACA,eACA,gBACA,YACA,UACA,aACA,OACA,WACA,QACA,aACA,sBACA,QACA,iBACA,YACA,QACA,OACA,WACA,WACA,gBACA,OACA,aACA,cACA,6BACA,SACA,UACA,WACA,WACA,UACA,6BACA,oCACA,OACA,UACA,aACA,gBACA,MACA,OACA,cA43BOyW,GAAAA,YAAmC,CAAC,KAAM,KAAM,MAChDA,GAAAA,WAAa,CAAC,IAAK,QACnBA,GAAAA,SAAW,CAAC,IAAK,OACjBA,GAAAA,wBAA0B,CAAC,KAC3BA,GAAAA,sBAAwB,GACxBA,GAAAA,iBAAmB,CAAC,KAAM,KAC1BA,GAAAA,iBAAmB,CAAEzP,OAAQ,MAC7ByP,GAAAA,UAAY,CAAC,KAAM,KAAM,KAAM,MAAO,KAAM,KAAM,KAAM,OC1yCjE,IAofqBC,GAAAA,SAAAA,I,8xBAcnB,WACE,OAAO,IAAI1Q,EAAU,CACnB6B,iBAAkB6O,EAAc7O,iBAChCC,uBAAwB4O,EAAc5O,uBACtCH,yBAA0B+O,EAAc/O,yBACxCI,uBAAwB2O,EAAc3O,uBACtCH,yBAA0B8O,EAAc9O,yBACxCjD,iBAAkB+R,EAAc/R,iBAChCM,YAAayR,EAAczR,YAC3BkD,WAAYuO,EAAcvO,WAC1BC,SAAUsO,EAActO,SACxBS,sBAAuB6N,EAAc7N,sBACrCrC,iBAAkBkQ,EAAclQ,iBAChCyB,UAAWyO,EAAczO,iB,uEA3BVyO,CAAsBvJ,G,+/BAClCuJ,GAAAA,iBA9FgB,CACvB,SACA,cACA,oBACA,cACA,qBACA,oBACA,kBACA,eACA,uBACA,eACA,eACA,SACA,kBACA,gBACA,aACA,qBACA,aACA,UACA,mBACA,UACA,QACA,QACA,SACA,QACA,UACA,YACA,SACA,uBACA,YACA,SACA,kBACA,SACA,oBACA,SAEA,aACA,OACA,WACA,SACA,cACA,MACA,QACA,SACA,OACA,WACA,qBACA,aACA,MACA,OACA,SACA,WACA,SACA,QACA,QAyCOA,GAAAA,uBAjCsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBACA,QACA,YACA,iBAEA,OACA,aACA,YACA,kBACA,aACA,oBAcOA,GAAAA,yBANwB,CAAC,OAAQ,QAOjCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,KAAM,OACzCA,GAAAA,iBAAmB1W,EAAO,GAAD,OAjRT,CACvB,MACA,QACA,UACA,MACA,QACA,KACA,MACA,KACA,QACA,UACA,SACA,UACA,QACA,SACA,QACA,KACA,OACA,OACA,OACA,UACA,UACA,aACA,SACA,YACA,UACA,WACA,YACA,aACA,QACA,SACA,UACA,WACA,UACA,YACA,UACA,YACA,UACA,OACA,WACA,WACA,KACA,OACA,OACA,UACA,QACA,UACA,SACA,QACA,QACA,SACA,QACA,UACA,QACA,YACA,MACA,QACA,MACA,WACA,SACA,QACA,SACA,MACA,OACA,KACA,SACA,QACA,KACA,UACA,YACA,QACA,SACA,QACA,OACA,KACA,YACA,aACA,MACA,OACA,WACA,QACA,WACA,OACA,OACA,UACA,QACA,OACA,MACA,MACA,UACA,UACA,eACA,UACA,YACA,KACA,KACA,MACA,OACA,QACA,SACA,SACA,SACA,SACA,UACA,QACA,SACA,QACA,OACA,QACA,YACA,WACA,OACA,OACA,YACA,UACA,UACA,YACA,QACA,YACA,SACA,QACA,MACA,QACA,SACA,SACA,UACA,SACA,QACA,OACA,WACA,MACA,OACA,YACA,SACA,QACA,OACA,OACA,OACA,QACA,aACA,SACA,SACA,OACA,OACA,KACA,OACA,cACA,UACA,OACA,WACA,YACA,QACA,SACA,UACA,QACA,MACA,OACA,WACA,QACA,SACA,MACA,OACA,QACA,SACA,SACA,QA9YwB,CACxB,QACA,MACA,OACA,UACA,YACA,YACA,eACA,YACA,sBACA,eACA,iBACA,cACA,iBACA,eACA,gBACA,eACA,eACA,kBACA,eACA,YACA,YACA,aACA,iBACA,gBACA,YACA,cACA,eACA,eACA,gBACA,gBACA,aACA,aACA,YACA,gBACA,iBACA,iBACA,cACA,OACA,OACA,QACA,MACA,SACA,gBACA,gBACA,UACA,YACA,UACA,SACA,UACA,YACA,WACA,UACA,OACA,cACA,eACA,YACA,WACA,YACA,WACA,SACA,UACA,WACA,iBACA,sBACA,wBACA,MACA,QACA,QACA,SACA,YACA,OACA,kBACA,eACA,mBACA,gBACA,kBACA,mBACA,gBACA,oBACA,iBACA,oBACA,iBACA,SACA,cACA,UACA,aACA,kBAEA,eACA,cACA,MACA,cACA,QACA,WACA,YACA,QACA,YACA,kBACA,QACA,aACA,SACA,UACA,UACA,SACA,WACA,YACA,WACA,WACA,WACA,MACA,aACA,OACA,QACA,SACA,KACA,MACA,QACA,QACA,MACA,OACA,SACA,OACA,SACA,kBACA,gBACA,eACA,gBACA,sBACA,MACA,YACA,QACA,WACA,YACA,aACA,UACA,SACA,UACA,YACA,QACA,SACA,MACA,OACA,aACA,gBACA,qBACA,sBACA,gBACA,eACA,eACA,aACA,gBACA,gBACA,iBACA,gBACA,gBACA,QACA,eACA,KACA,cACA,WACA,WACA,QACA,UACA,SACA,OACA,kBACA,kBACA,cACA,iBACA,kBACA,iBACA,eACA,iBACA,aACA,gBACA,iBACA,gBACA,cACA,SACA,UACA,UACA,QACA,aACA,QACA,SACA,cACA,eACA,OACA,MACA,QACA,OACA,SACA,aACA,cACA,kBACA,gBACA,YACA,aACA,mBACA,SACA,WACA,MACA,MACA,QACA,UACA,SACA,YACA,SACA,SACA,WACA,WACA,WACA,OACA,QAEA,QACA,OACA,WACA,eACA,gBACA,UACA,WACA,iBACA,iBA2RO0W,GAAAA,YAAmC,CAAC,KAAM,KAAM,MAChDA,GAAAA,WAAa,CAAC,IAAK,IAAK,IAAK,QAC7BA,GAAAA,SAAW,CAAC,IAAK,IAAK,IAAK,OAC3BA,GAAAA,sBAAwB,CAAC,KACzBA,GAAAA,iBAAmB,CAAC,IAAK,MACzBA,GAAAA,UAAY,CAAC,MCjgBtB,IAkbqBC,GAAAA,SAAAA,I,8xBA0BnB,WACE,OAAO,IAAI3Q,EAAU,CACnB6B,iBAAkB8O,EAAe9O,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A,YACA,SACA,MACA,UACA,aACA,SACA,iBACA,YACA,QACA,OACA,UACA,OACA,QACA,UACA,OACA,KACA,OAEA,OACA,UACA,UACA,OACA,OACA,YACA,UACA,cACA,YACA,YACA,QACA,YACA,QACA,QACA,UACA,WACA,WACA,UACA,UACA,UACA,UACA,SACA,YACA,WACA,WACA,UACA,WACA,cACA,UACA,WACA,UACA,QACA,QACA,SACA,aACA,UACA,UACA,SACA,cACA,WACA,OACA,OACA,YACA,MACA,UACA,UACA,SACA,QACA,OACA,gBACA,YACA,WACA,KACA,SACA,OACA,WACA,UACA,QACA,QACA,SACA,aACA,YACA,UACA,SACA,OACA,UACA,WACA,UACA,QACA,QACA,QACA,QACA,QACA,QACA,MACA,SACA,QACA,WACA,UACA,OACA,QACA,QACA,OACA,OACA,SACA,OACA,aACA,KACA,YACA,KACA,YACA,QACA,UACA,YACA,UACA,WACA,eACA,MACA,UACA,YACA,WACA,OACA,aACA,KACA,YACA,OACA,WACA,QACA,UACA,SACA,QACA,UACA,OACA,QACA,QACA,QACA,UACA,QACA,OACA,OACA,MACA,MACA,SACA,SACA,QACA,MACA,SACA,WACA,MACA,OACA,QACA,WACA,OACA,MACA,WACA,SACA,UACA,WACA,QACA,MACA,UACA,aACA,SACA,MACA,SACA,OACA,SACA,SACA,cACA,SACA,UACA,UACA,cACA,cACA,cACA,gBACA,YACA,SACA,SACA,eACA,WACA,YACA,UACA,KACA,MACA,YACA,YACA,OACA,SACA,OACA,WACA,SACA,SACA,UACA,QACA,eACA,SACA,UACA,SACA,MACA,WACA,aACA,UACA,kBACA,YACA,aACA,SACA,YACA,SACA,UACA,OACA,YACA,cACA,YACA,WACA,YACA,SACA,YACA,QACA,UACA,YACA,SACA,QACA,QACA,MACA,OACA,OACA,SACA,MACA,YACA,UACA,YACA,MACA,YACA,SACA,WACA,SACA,eACA,SACA,UACA,SACA,WACA,MACA,QACA,SACA,UACA,SACA,OACA,YACA,MACA,MACA,MACA,SACA,SACA,UACA,OACA,WACA,WACA,eACA,QACA,QACA,OACA,SACA,WACA,OACA,QACA,SACA,MACA,UACA,UACA,UACA,UACA,WACA,WACA,QACA,SACA,SACA,SACA,SACA,SACA,QACA,cACA,eACA,gBACA,UACA,aACA,MACA,UACA,UACA,UACA,QACA,MACA,MACA,OACA,OACA,YACA,gBACA,gBACA,kBACA,kBACA,KACA,WACA,cACA,gBACA,UACA,OACA,UACA,OACA,MACA,MACA,MACA,MACA,QACA,SACA,SACA,WACA,YACA,MACA,OACA,WACA,SACA,QACA,UACA,WACA,WACA,WACA,SACA,UACA,OACA,QACA,OACA,WACA,QACA,OACA,UACA,QACA,OACA,SA8FO2W,GAAAA,YAAmC,CAAC,KAAM,MAAO,KAAM,MACvDA,GAAAA,WAAa,CAAC,IAAK,QACnBA,GAAAA,SAAW,CAAC,IAAK,OACjBA,GAAAA,wBAA0B,CAAC,KAC3BA,GAAAA,sBAAwB,CAAC,KACzBA,GAAAA,iBAAmB,CAAC,MACpBA,GAAAA,iBAAmB,CAAEtP,IAAK,SAC1BsP,GAAAA,UAAY,CACjB,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MCxcJ,IA2nDqBE,GAAAA,SAAAA,I,8xBAkBnB,WACE,OAAO,IAAI7Q,EAAU,CACnB6B,iBAAkBgP,EAAoBhP,iBACtCC,uBAAwB+O,EAAoB/O,uBAC5CH,yBAA0BkP,EAAoBlP,yBAC9CI,uBAAwB8O,EAAoB9O,uBAC5CH,yBAA0BiP,EAAoBjP,yBAC9CjD,iBAAkBkS,EAAoBlS,iBACtCM,YAAa4R,EAAoB5R,YACjCkD,WAAY0O,EAAoB1O,WAChCC,SAAUyO,EAAoBzO,SAC9BM,wBAAyBmO,EAAoBnO,wBAC7CG,sBAAuBgO,EAAoBhO,sBAC3CrC,iBAAkBqQ,EAAoBrQ,iBACtCyB,UAAW4O,EAAoB5O,iB,uEAhChB4O,CAA4B1J,G,ovDACxC0J,GAAAA,iBA9RgB,CACvB,QACA,kBACA,kBACA,mBACA,iBACA,2BACA,eACA,sBACA,kBACA,6BACA,sBACA,iBACA,cACA,cACA,iBACA,qBACA,0BACA,iBACA,uBACA,wBACA,eACA,kBACA,oBACA,aACA,gBACA,aACA,eACA,iBACA,eACA,mBACA,qBACA,eACA,cACA,mBACA,kCACA,+BACA,2BACA,6BACA,gBACA,aACA,aACA,qBACA,aACA,UACA,QACA,OACA,aACA,QACA,UACA,UACA,SACA,kBACA,OACA,uBACA,mBACA,cACA,mBACA,oBACA,kBACA,gBACA,uBACA,mBACA,8BACA,uBACA,kBACA,eACA,eACA,kBACA,2BACA,kBACA,wBACA,yBACA,gBACA,mBACA,qBACA,cACA,cACA,gBACA,kBACA,gBACA,oBACA,sBACA,eACA,kBACA,oBACA,mCACA,gCACA,4BACA,8BACA,mBACA,iBACA,cACA,cACA,sBACA,cACA,aACA,UACA,SACA,UACA,KACA,qBACA,iBACA,YACA,iBACA,kBACA,gBACA,cACA,qBACA,iBACA,4BACA,qBACA,gBACA,aACA,aACA,gBACA,yBACA,gBACA,sBACA,uBACA,aACA,cACA,iBACA,mBACA,YACA,eACA,YACA,cACA,gBACA,cACA,kBACA,oBACA,aACA,kBACA,iCACA,8BACA,0BACA,4BACA,iBACA,eACA,YACA,YACA,oBACA,YACA,MACA,UACA,UACA,QACA,QACA,wBACA,SACA,SACA,OACA,OACA,OACA,SACA,UACA,sBACA,iBACA,4BACA,UACA,oBACA,QACA,YACA,SACA,WACA,oBACA,wBACA,YACA,iBACA,SACA,cACA,MACA,kBACA,WACA,4BACA,kBACA,OACA,oBACA,WACA,WACA,SACA,SACA,SAEA,MACA,QACA,eACA,cACA,aACA,OACA,WACA,SACA,QACA,SACA,WACA,QACA,QA0FOA,GAAAA,uBAlFsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBACA,QACA,YACA,iBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,YACA,kBACA,aACA,gBA2DOA,GAAAA,yBAnDwB,CAAC,OAAQ,QAoDjCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,MACnCA,GAAAA,iBAAmB7W,EAAO,GAAD,UAC3BZ,OAAOuH,OAloDY,CAExBmN,KAAM,CACJ,MACA,OACA,QACA,QACA,OACA,QACA,QACA,OACA,QACA,SACA,QACA,QACA,OACA,OACA,UACA,MACA,OACA,OACA,MACA,OACA,UACA,MACA,MACA,YACA,QACA,MACA,MACA,KACA,MACA,QACA,YACA,MACA,KACA,QACA,UACA,SACA,QACA,QACA,UACA,OACA,MACA,OACA,OACA,OACA,MACA,OACA,OACA,aACA,QACA,gBAGFvT,OAAQ,CACN,MACA,QACA,aACA,QACA,mBACA,cACA,MACA,SACA,YACA,SACA,UACA,OACA,SACA,QACA,OACA,QACA,MACA,YACA,eACA,UACA,cACA,qBACA,WACA,cACA,gBACA,iBACA,eACA,iBACA,iBACA,wBACA,wBACA,SACA,UACA,UACA,QACA,OACA,QACA,aACA,UACA,cACA,aACA,kBACA,kBACA,SACA,SACA,YACA,WACA,SACA,YACA,OACA,SACA,SAGFuW,OAAQ,CACN,YACA,aACA,QACA,UACA,eACA,aACA,SACA,SACA,UACA,WACA,SACA,QACA,MACA,eACA,UACA,WACA,QACA,UACA,WACA,SACA,SACA,SACA,SACA,aACA,SACA,YACA,QAGFC,UAAW,CACT,YACA,aACA,UACA,SACA,eACA,UACA,WACA,UACA,aAGFrR,QAAS,CACP,eACA,iBACA,iBACA,wBACA,yBAGFsR,SAAU,CAAC,UAAW,UAAW,YAAa,gBAE9C1D,SAAU,CAER,kBACA,eACA,eACA,oBACA,WACA,YACA,aACA,UACA,WACA,eACA,gBACA,mBACA,YACA,iBACA,YACA,gBACA,YACA,iBACA,mBACA,MACA,WACA,eACA,iBACA,sBACA,YACA,eACA,yBAGF2D,KAAM,CAAC,aAAc,YAAa,cAElCC,SAAU,CACR,OACA,YACA,MACA,SACA,SACA,WACA,WACA,SACA,WACA,SACA,SACA,OACA,OACA,UACA,OACA,SACA,QACA,UACA,QACA,SACA,QACA,SAGFC,QAAS,CACP,SACA,YACA,SACA,OACA,WACA,aACA,mBACA,mBACA,UACA,UACA,UACA,cACA,OACA,SAGFC,WAAY,CACV,oBACA,wBACA,oBACA,mBACA,SACA,UACA,mBACA,kBACA,YACA,YACA,QACA,aACA,cACA,iBACA,oBACA,WACA,YACA,YACA,cACA,YACA,WACA,UACA,aACA,aACA,UACA,gBACA,wBAGF9C,KAAM,CAAC,QAEP+C,IAAK,CACH,gBACA,sBACA,kBACA,wBACA,gCACA,UACA,eACA,qBACA,6BACA,gBACA,sBACA,8BACA,SACA,eACA,qBACA,6BACA,SACA,aACA,YACA,aACA,YACA,YACA,WACA,QACA,UACA,eACA,WACA,qBACA,6BACA,8BACA,QACA,gBAGFxD,KAAM,CACJ,gBACA,YACA,uBACA,4BACA,qBACA,oBACA,qBACA,aACA,kBACA,qBACA,0BACA,eACA,eACA,mBACA,oBACA,oBACA,uBACA,mBACA,sBACA,mBACA,yBACA,4BACA,yBACA,4BACA,sBACA,wBACA,2BACA,eACA,YACA,gBACA,oBACA,kBACA,qBACA,eACA,WACA,sBACA,2BACA,oBACA,mBACA,oBACA,YACA,iBACA,oBACA,yBACA,cACA,kBACA,mBACA,uBACA,0BACA,mBACA,iBACA,oBACA,cACA,cACA,UACA,WACA,gBAGFyD,SAAU,CAAC,UAAW,UAAW,UAAW,UAE5C/C,YAAa,CAEX,WACA,WACA,QACA,UAGFrB,MAAO,CACL,YACA,eACA,YACA,aACA,aACA,eACA,cACA,cACA,iBACA,kBACA,gBACA,eACA,gBACA,kBACA,cACA,cACA,kBACA,aACA,UAGFqE,MAAO,CACL,UACA,QACA,YACA,YACA,aACA,cACA,QACA,YACA,aAGFvE,UAAW,CACT,MACA,YACA,MACA,UACA,SACA,UACA,WACA,UACA,WACA,OACA,QACA,YACA,aACA,YACA,aACA,QACA,WACA,YACA,mBACA,WACA,kBACA,MACA,MACA,OACA,kBACA,kBACA,eACA,YACA,sBACA,OACA,YACA,YACA,aACA,iBACA,UACA,aACA,WACA,WACA,WACA,OACA,SACA,aACA,cACA,aACA,MACA,UACA,WACA,WACA,UACA,WACA,UAGFwE,OAAQ,CACN,YACA,aACA,cACA,MACA,aACA,OACA,YACA,QACA,eACA,OACA,cAGFC,IAAK,CAAC,kBAAmB,uBAEzBC,QAAS,CACP,aACA,aACA,kBACA,kBACA,mBACA,gBACA,eACA,iBACA,kBACA,eACA,cACA,2BACA,uBACA,yBACA,qCACA,yBACA,yBACA,uBACA,yBACA,uBACA,2BACA,sBACA,qBACA,mBACA,mBACA,mBACA,mBACA,cACA,kBACA,iBACA,mBACA,0BACA,oBACA,wBACA,kBACA,oBACA,2BACA,qBACA,sBACA,qBACA,iCACA,qBACA,yBACA,8BACA,uBACA,cACA,qBACA,4BACA,qCACA,yBACA,kBACA,kBACA,wBACA,wBACA,iBACA,yBACA,0BACA,oBACA,kBACA,iBACA,cACA,qBACA,gCACA,0BACA,+BACA,wBACA,0BACA,mBACA,yBACA,wBACA,oBACA,8BACA,wBACA,yBACA,yBACA,sBACA,2BACA,iCACA,kBACA,mBACA,mBACA,+BACA,0BACA,yBACA,sBACA,mBACA,0BACA,wBACA,0BACA,4BACA,YACA,qBACA,yBACA,2BACA,kCACA,iBACA,kBACA,sBACA,eACA,oBACA,cACA,kBACA,kBACA,aACA,iBACA,aACA,kBACA,aACA,aACA,eACA,2BACA,wBACA,oBACA,qBACA,qBACA,cACA,2BACA,OACA,WAGFC,SAAU,CACR,yBACA,4BACA,uBACA,eACA,kBACA,yBACA,mBACA,0BACA,qBACA,yBACA,4BACA,wBACA,+BACA,uBACA,oBACA,8BACA,wBACA,iBACA,mCACA,oCACA,qCACA,sCACA,0BACA,2BACA,4BACA,qBACA,mBACA,2BACA,qBACA,uBACA,gCACA,8BACA,kBACA,kBACA,oBACA,0BACA,0BACA,yBACA,gCACA,0BACA,qCACA,8BACA,sCACA,+BACA,iCACA,0BACA,YACA,eACA,eACA,eACA,yBACA,oBACA,oBACA,aACA,sBACA,eACA,uBACA,uBACA,mBACA,iBACA,gCACA,+BACA,6BACA,4BACA,iCACA,yCACA,yCACA,sCACA,sCACA,mCACA,mCACA,8BACA,oBACA,gBACA,iBACA,kBACA,eACA,iBACA,gBACA,qBACA,gBACA,uBACA,yBACA,uBACA,8BACA,4BACA,mCACA,kBACA,yBACA,kBACA,sBACA,uBACA,cAGFC,QAAS,CACP,qCACA,0BACA,kCAGFC,aAAc,CACZ,gCACA,mCACA,qCACA,wCACA,yBAGFC,MAAO,CAAC,uBA47B8B9W,QAAO,SAAC6I,EAAK5J,GAAN,mBAAkB4J,GAAlB,GAA0B5J,MAAM,KAn7BtD,CACvB,SACA,WACA,SACA,YACA,SACA,MACA,QACA,YACA,MACA,WACA,OACA,QACA,SACA,UACA,MACA,QACA,wBACA,KACA,MACA,aACA,YACA,aACA,aACA,KACA,SACA,SACA,YACA,aACA,gBACA,WACA,SACA,SACA,cACA,kBACA,YACA,UACA,SACA,SACA,MACA,OACA,UACA,MACA,UACA,OACA,UACA,KACA,QACA,SACA,UACA,WACA,OACA,UACA,eACA,QACA,WACA,OACA,YACA,kBACA,aACA,wBACA,qBACA,uBACA,QACA,QACA,aACA,eACA,OACA,QACA,UACA,YACA,oBACA,iBACA,mBACA,UACA,SACA,UACA,cACA,mBACA,wBACA,WACA,YACA,cACA,eACA,YACA,cACA,mBACA,gBACA,WACA,UACA,aACA,kBACA,aACA,cACA,qBACA,kBACA,oBACA,cACA,WACA,UACA,WACA,UACA,aACA,gBACA,OACA,SACA,QACA,MACA,OACA,UACA,kCACA,eACA,cACA,mCACA,SACA,cACA,QACA,OACA,WACA,WACA,OACA,yBACA,8BACA,MACA,KACA,MACA,WACA,UACA,UACA,WACA,aACA,WACA,SACA,UACA,UACA,SACA,YACA,aACA,UACA,QACA,QACA,UACA,OACA,WACA,aACA,SACA,gBACA,cACA,aACA,UACA,aACA,WACA,WACA,YACA,iBACA,gBACA,oBACA,qBACA,YACA,gBACA,iBACA,cACA,cACA,UACA,WACA,SACA,SACA,OACA,UACA,mBACA,wBACA,OACA,UACA,QACA,SACA,WACA,YACA,WACA,YACA,gBACA,WACA,OACA,SACA,QACA,SACA,QACA,YACA,UACA,YACA,YACA,OACA,SACA,aACA,YACA,WACA,QACA,OACA,SACA,QACA,WACA,SACA,QACA,OACA,QACA,YACA,MACA,QACA,UACA,UACA,UACA,QACA,YACA,OACA,SACA,KACA,UACA,OACA,WACA,YACA,SACA,UACA,YACA,MACA,SACA,KACA,OACA,UACA,QACA,SACA,UACA,SACA,MACA,YACA,OACA,OAEA,WACA,KACA,SACA,QACA,YACA,cACA,YACA,iBACA,WACA,SACA,KACA,UACA,YACA,YACA,SACA,QACA,UACA,YACA,UACA,WACA,UACA,YACA,SACA,QACA,QACA,QACA,cACA,WACA,eACA,UACA,MACA,UACA,YACA,eACA,WACA,OACA,UACA,KACA,SACA,YACA,OACA,aACA,gBACA,cACA,iBACA,aACA,aACA,uBACA,aACA,OACA,MACA,OACA,aACA,WACA,QACA,WACA,QACA,OACA,UACA,UACA,YACA,QACA,UACA,OACA,aACA,OACA,UACA,QACA,WACA,UACA,SACA,SACA,MACA,UACA,QACA,UACA,UACA,eACA,kBACA,eACA,WACA,WACA,SACA,QACA,iBACA,uBACA,eACA,SACA,SACA,WACA,WACA,SACA,QACA,OACA,WACA,QACA,OACA,QACA,YACA,WACA,UACA,QACA,QACA,SACA,UACA,MACA,OACA,MACA,MACA,OACA,OACA,MACA,KACA,OACA,aACA,MACA,UACA,UACA,SACA,OACA,WACA,QACA,SACA,UACA,SACA,oBACA,SACA,KACA,MACA,SACA,OACA,MACA,OACA,YACA,YACA,YACA,MACA,OACA,OACA,WACA,SACA,UACA,QACA,WACA,aACA,SACA,MACA,QACA,SACA,OACA,WACA,WACA,aACA,QACA,QACA,MACA,WACA,YACA,iBACA,iBACA,6BACA,6BACA,0BACA,4BACA,SACA,UACA,YACA,SACA,OACA,UACA,cACA,WACA,OACA,UACA,MACA,UACA,SACA,aACA,UACA,UACA,OACA,QACA,MACA,SACA,UACA,iBACA,WACA,YACA,YACA,WACA,WACA,UACA,QACA,UACA,aACA,aACA,YACA,aACA,UACA,QACA,MACA,SACA,cACA,QACA,SACA,QACA,OACA,QACA,OACA,WACA,UACA,WACA,YACA,MACA,aACA,cACA,UACA,WACA,UACA,SACA,aACA,UACA,YACA,UACA,UACA,UACA,WACA,SACA,SACA,uBACA,kBACA,wBACA,oBACA,UACA,OACA,SACA,UACA,WACA,kBACA,eACA,iBACA,MACA,OACA,YACA,OACA,UACA,SACA,SACA,UACA,cACA,QACA,gBACA,aACA,eACA,SACA,SACA,SACA,UACA,WACA,OACA,YACA,OACA,YACA,WACA,YACA,eACA,SACA,cACA,UACA,QACA,OACA,QACA,UACA,SACA,OACA,OACA,WACA,WACA,SACA,QACA,WACA,eACA,gBACA,MACA,UACA,WACA,eACA,WACA,aACA,SACA,aACA,QACA,QACA,YACA,SACA,aACA,QACA,SACA,UACA,SACA,SACA,YACA,QACA,kBACA,cACA,eACA,SACA,kBACA,WACA,UACA,YACA,QACA,SACA,cACA,cACA,QACA,SACA,cACA,aACA,aACA,OACA,WACA,YACA,OACA,UACA,OACA,OACA,YACA,gBACA,kBACA,KACA,QACA,kBACA,WACA,cACA,yBACA,2BACA,qBACA,YACA,aACA,kBACA,cACA,QACA,UACA,kBACA,eACA,iBACA,OACA,UACA,OACA,QACA,UACA,YACA,cACA,gBACA,QACA,cACA,SACA,UACA,SACA,WACA,YACA,UACA,QACA,UACA,MACA,QACA,4BACA,yBACA,yBACA,2BACA,QACA,QACA,OACA,QACA,WACA,YACA,QACA,WACA,YACA,UACA,WACA,UACA,UACA,aACA,OACA,QACA,WACA,WACA,aACA,SACA,SACA,UACA,OACA,UACA,QACA,MACA,gBACA,YACA,UACA,iBACA,cACA,aACA,gBACA,WACA,YACA,UACA,cACA,OACA,MACA,UAgTO4W,GAAAA,YAAmC,CAAC,KAAM,KAAM,OAAQ,OAAQ,KAAM,KAAM,OAC5EA,GAAAA,WAAa,CAAC,IAAK,QACnBA,GAAAA,SAAW,CAAC,IAAK,OACjBA,GAAAA,wBAA0B,CAAC,KAC3BA,GAAAA,sBAAwB,CAAC,KACzBA,GAAAA,iBAAmB,CAAC,MACpBA,GAAAA,UA9De,CACtB,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,OACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,OCxnDF,IAmsBqBkB,GAAAA,SAAAA,I,8xBAkBnB,WACE,OAAO,IAAI/R,EAAU,CACnB6B,iBAAkBkQ,EAAkBlQ,iBACpCC,uBAAwBiQ,EAAkBjQ,uBAC1CH,yBAA0BoQ,EAAkBpQ,yBAC5CI,uBAAwBgQ,EAAkBhQ,uBAC1CH,yBAA0BmQ,EAAkBnQ,yBAC5CjD,iBAAkBoT,EAAkBpT,iBACpCM,YAAa8S,EAAkB9S,YAC/BkD,WAAY4P,EAAkB5P,WAC9BC,SAAU2P,EAAkB3P,SAC5BM,wBAAyBqP,EAAkBrP,wBAC3CG,sBAAuBkP,EAAkBlP,sBACzCrC,iBAAkBuR,EAAkBvR,iBACpCyB,UAAW8P,EAAkB9P,iB,uEAhCd8P,CAA0B5K,G,ovDACtC4K,GAAAA,iBA3IgB,CACvB,QACA,iBACA,kBACA,2BACA,cACA,0BACA,kBACA,eACA,cACA,qBACA,aACA,UACA,UACA,sBACA,sBACA,QACA,OACA,SACA,QACA,UACA,SACA,OACA,kBACA,mBACA,2BACA,yBACA,wBACA,kBACA,eACA,iBACA,2BACA,eACA,mBACA,gBACA,eACA,kBACA,cACA,cACA,aACA,UACA,SACA,iBACA,gBACA,iBACA,gBACA,aACA,eACA,aACA,yBACA,iBACA,cACA,aACA,YACA,YACA,OACA,MACA,UACA,UACA,QACA,OACA,QACA,SACA,SACA,OACA,UACA,4BACA,QACA,SACA,WACA,SACA,cACA,MACA,4BACA,8BACA,OACA,sBACA,aACA,kBACA,iBACA,aACA,YACA,oBACA,WACA,SACA,SACA,SACA,QACA,OAEA,WACA,WACA,QACA,SACA,SACA,SACA,cACA,eACA,cA0COA,GAAAA,uBAlCsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,YACA,kBACA,aACA,gBAcOA,GAAAA,yBANwB,CAAC,OAAQ,QAOjCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,MACnCA,GAAAA,iBAAmB/X,EAAO,GAAD,UAC3BZ,OAAOuH,OA1sBY,CAExBqM,UAAW,CACT,YACA,8BACA,MACA,QACA,UACA,MACA,SACA,MACA,kBACA,cACA,aACA,MACA,WACA,WAGFE,MAAO,CACL,QACA,eACA,gBACA,mBACA,iBACA,YAGFC,QAAS,CAAC,UAAW,SAAU,WAAY,WAE3CoB,YAAa,CAAC,OAAQ,WAAY,SAAU,WAAY,QAAS,MAAO,OAAQ,UAEhFyD,SAAU,CACR,aACA,eACA,mBACA,eACA,eACA,oBACA,WACA,qBACA,uBACA,iBACA,UACA,WACA,YACA,aACA,UACA,UACA,eACA,WACA,iBACA,WACA,UACA,YACA,gBACA,qBACA,4BACA,kBACA,uBACA,4BACA,WACA,eACA,SAGFC,QAAS,CACP,UACA,WACA,eACA,cACA,WACA,UACA,cACA,YACA,YACA,eACA,YACA,aACA,cACA,aACA,cACA,sBACA,gBACA,eACA,YACA,aACA,eACA,cACA,cACA,oBACA,aACA,cACA,cACA,YACA,kBACA,aACA,aACA,cACA,cACA,aACA,eACA,kBACA,kBACA,kBACA,kBACA,iBACA,mBACA,gBACA,kBACA,iBACA,cACA,kBACA,aACA,cACA,aACA,YACA,kBACA,cACA,wBACA,0BACA,OACA,kBACA,cACA,eACA,iBACA,aACA,UACA,UACA,WACA,WACA,aACA,YACA,mBACA,sBACA,eACA,eACA,iBACA,WACA,YACA,YACA,aACA,iBACA,aACA,cACA,aACA,cACA,UACA,gBACA,aACA,YACA,OACA,UACA,UACA,OACA,UACA,UACA,OACA,UACA,UACA,gBAGFvE,KAAM,CAAC,WAAY,YAAa,WAAY,MAAO,MAAO,OAAQ,QAElEwE,YAAa,CAAC,MAAO,oBAAqB,kBAAmB,eAE7DrE,KAAM,CACJ,gBACA,sBACA,oBACA,kCACA,yBACA,aACA,kBAGFC,KAAM,CACJ,MACA,OACA,OACA,OACA,QACA,OACA,UACA,OACA,MACA,MACA,UACA,OACA,QACA,SACA,MACA,QACA,KACA,MACA,MACA,KACA,QACA,UACA,SACA,QACA,MACA,OACA,OACA,MACA,SACA,SAGFqE,gBAAiB,CAAC,iBAElB5X,OAAQ,CACN,QACA,YACA,QACA,qBACA,cACA,mBACA,YACA,MACA,UACA,SACA,QACA,aACA,UACA,OACA,QACA,MACA,SACA,QACA,OACA,OACA,QACA,aACA,eACA,WACA,cACA,gBACA,eACA,eACA,iBACA,gBACA,SACA,UACA,YACA,UACA,QACA,UACA,aACA,SACA,SACA,YACA,UACA,YACA,OACA,SAGF6X,UAAW,CACT,oBACA,gBACA,WACA,YACA,aACA,UACA,aACA,WACA,aACA,YACA,YACA,cACA,aACA,eAGFZ,OAAQ,CACN,MACA,QACA,YACA,aACA,cACA,aACA,MACA,OACA,UACA,MACA,SACA,MACA,YACA,QACA,eACA,kBACA,kBACA,OACA,kBACA,aACA,cACA,aACA,MACA,WACA,WAGFa,SAAU,CACR,OACA,UACA,UACA,UACA,YACA,kBACA,uBAGFV,SAAU,CACR,wBACA,0BACA,uBACA,kBACA,oBACA,uBACA,iBACA,cAGFD,QAAS,CACP,sBACA,mBACA,oBACA,iBACA,kBACA,eACA,kBACA,2BACA,yBACA,uBACA,sBACA,iBACA,cACA,6BACA,0BACA,gCACA,qBACA,kBACA,oBACA,mBACA,uBACA,eACA,YACA,OACA,aA4WoC1W,QAAO,SAAC6I,EAAK5J,GAAN,mBAAkB4J,GAAlB,GAA0B5J,MAAM,KAD7C,GAE3Bb,OAAOuH,OApWW,CAEvBqP,SAAU,CACR,SACA,SACA,MACA,iBACA,MACA,QACA,KACA,MACA,gBACA,SACA,UACA,SACA,OACA,QACA,SACA,aACA,SACA,QACA,UACA,aACA,UACA,SACA,OACA,UACA,WACA,KACA,SACA,SACA,UACA,aACA,WACA,QACA,MACA,UACA,SACA,OACA,OACA,gBACA,gBACA,QACA,WACA,SACA,QACA,KACA,YACA,QACA,OACA,KACA,SACA,WACA,UACA,OACA,QACA,YACA,iBACA,MACA,OACA,QACA,UACA,MACA,MACA,UACA,OACA,QACA,MACA,UACA,SACA,MACA,MACA,OACA,OACA,QACA,QACA,WACA,WACA,YACA,UACA,cACA,UACA,UACA,UACA,aACA,YACA,SACA,UACA,UACA,UACA,WACA,OACA,SACA,QACA,MACA,OACA,OACA,YACA,KACA,MACA,WACA,OACA,SACA,UACA,SACA,WAGFsC,qBAAsB,CACpB,gBACA,iBACA,eACA,aACA,cACA,WACA,SACA,eACA,aACA,mBACA,eACA,UACA,eACA,UACA,aACA,aACA,mBAGFC,eAAgB,CAAC,WAAY,aAAc,WAAY,SAAU,cAEjEC,iBAAkB,CAChB,SACA,MACA,YACA,aACA,YACA,OACA,OACA,UACA,OAGFC,eAAgB,CACd,gBACA,cACA,YACA,WACA,uBACA,oBACA,iBAGFC,sBAAuB,CAAC,QAAS,OAAQ,OAAQ,QAEjDC,eAAgB,CAAC,WAAY,YAAa,SAAU,OAEpDC,qBAAsB,CACpB,MACA,OACA,WACA,QACA,WACA,MACA,UACA,WACA,WACA,YACA,UACA,WAEFlD,KAAM,CAEJ,eACA,aACA,WACA,iBAEA,OACA,OACA,MACA,YAEA,cACA,gBASFmD,UAAW,CACT,OACA,YACA,QACA,UACA,oBACA,WACA,SACA,UA4JmC7X,QAAO,SAAC6I,EAAK5J,GAAN,mBAAkB4J,GAAlB,GAA0B5J,MAAM,OAErE8X,GAAAA,YAAmC,CAAC,KAAM,KAAM,MACh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A,cACA,gBACA,gBACA,aACA,YACA,eACA,iBACA,eAEA,cACA,mBACA,6BACA,OAEA,SACA,OACA,aACA,gBACA,eACA,WACA,SACA,SACA,QACA,SACA,WACA,UACA,cACA,QACA,QACA,YACA,UAEA,WACA,UACA,gBACA,cACA,cACA,oBACA,oBACA,iBACA,iBACA,YACA,WACA,UACA,gBACA,mBACA,QACA,MACA,aACA,eACA,oBACA,iBACA,iBACA,kBACA,sBACA,cACA,qBACA,aACA,gBAEA,OACA,SACA,eACA,SACA,UAmEOA,GAAAA,uBA3DsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBACA,QACA,YACA,iBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,YACA,kBACA,aACA,eAEA,cACA,cAEA,YACA,YACA,iBACA,iBACA,mBACA,kBACA,oBACA,0BACA,qBACA,yBACA,0BACA,yBACA,qBACA,2BACA,0BACA,oBACA,cACA,eAcOA,GAAAA,yBANwB,CAAC,OAAQ,QAOjCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,KAAM,OACzCA,GAAAA,iBAAmB9Y,EAAO,GAAD,UAC3BZ,OAAOuH,OAtwBY,CAExBqM,UAAW,CACT,MACA,wBACA,oBACA,MACA,UACA,SACA,UACA,WACA,UACA,eACA,cACA,OACA,QACA,QACA,QACA,WACA,mBACA,YACA,aACA,QACA,QACA,cACA,WACA,cACA,WACA,OACA,aACA,MACA,SACA,OACA,MACA,SACA,aACA,aACA,oBACA,WACA,OACA,MACA,SACA,aACA,cACA,MACA,UACA,WACA,YAGFwE,OAAQ,CACN,YACA,aACA,MACA,OACA,YACA,QACA,eACA,OACA,cAGFtE,MAAO,CACL,QACA,iBACA,iBACA,eACA,kBACA,aACA,YACA,YACA,iBACA,eACA,eACA,cACA,iBACA,aACA,UACA,WACA,UACA,QACA,cAGFhO,IAAK,CACH,aACA,aACA,MACA,aACA,cACA,kBACA,mBACA,WACA,aACA,cAGFoO,SAAU,CACR,aACA,eACA,eACA,oBACA,oBACA,mBACA,WACA,cACA,sBACA,YACA,WACA,aACA,WACA,MACA,aACA,YACA,YACA,UACA,gBACA,qBACA,OACA,WACA,YACA,mBACA,gBACA,iBACA,mBACA,SACA,QACA,iBACA,WACA,MACA,UACA,SACA,iBACA,mBACA,mBACA,oBACA,UACA,eACA,oBACA,mBACA,QACA,YACA,cACA,cACA,eACA,iBACA,UACA,aACA,SACA,QAGFO,KAAM,CACJ,YACA,kBACA,oBACA,mBACA,aACA,iBACA,WAGF6B,KAAM,CACJ,MACA,OACA,QACA,YACA,aACA,QACA,OACA,QACA,cACA,OACA,QACA,QACA,SACA,SACA,MACA,SACA,YACA,UACA,aACA,UACA,SACA,QACA,cACA,OACA,OACA,UACA,OACA,cACA,mBACA,MACA,SACA,YACA,OACA,MACA,OACA,MACA,QACA,kBACA,mBACA,eACA,OACA,UACA,UACA,SAEA,MACA,MACA,QACA,YACA,cACA,QACA,QACA,SACA,gBACA,gBACA,WACA,SACA,OACA,MACA,QACA,UACA,SACA,eACA,0BACA,yBACA,kBACA,QACA,MACA,QACA,YACA,SACA,cACA,QACA,OACA,SACA,cACA,KACA,SACA,MACA,QACA,QACA,OACA,QACA,OACA,QACA,aACA,eACA,MACA,MACA,8BACA,eACA,QACA,WACA,MACA,OACA,eACA,UACA,YACA,KACA,OACA,aACA,mBACA,WACA,WACA,MACA,QACA,SACA,UACA,cACA,OACA,QACA,SACA,UACA,iBACA,qBACA,cACA,iBACA,SACA,UACA,UACA,QACA,OACA,QACA,OACA,QACA,gBACA,YACA,MACA,OACA,OACA,YACA,aACA,qBACA,OACA,SACA,MACA,OACA,WACA,UACA,QACA,qBACA,QACA,OACA,QACA,SACA,YACA,kBACA,MACA,OACA,YACA,UACA,SACA,iBACA,mBACA,YACA,OACA,UACA,aACA,SACA,QACA,WACA,QACA,QACA,OACA,UACA,eACA,QACA,gBACA,eACA,cACA,YACA,aACA,eACA,cACA,eACA,WACA,cAmboC1U,QAAO,SAAC6I,EAAK5J,GAAN,mBAAkB4J,GAAlB,GAA0B5J,MAAM,KAzatD,CACvB,MACA,QACA,MACA,QACA,UACA,MACA,OACA,MACA,UACA,QACA,KACA,MACA,KACA,gBACA,UACA,OACA,SACA,UACA,KACA,QACA,UACA,OACA,SACA,QACA,QACA,UACA,YACA,UACA,UACA,aACA,SACA,UACA,UACA,SACA,UACA,cACA,UACA,cACA,aACA,OACA,SACA,QACA,OACA,UACA,eACA,eACA,oBACA,eACA,OACA,WACA,YACA,MACA,eACA,UACA,SACA,YACA,OACA,WACA,MACA,cACA,YACA,WACA,aACA,MACA,OACA,SACA,UACA,SACA,WACA,SACA,SACA,WACA,WACA,UACA,QACA,QACA,SACA,SACA,aACA,QACA,cACA,YACA,MACA,UACA,SACA,YACA,OACA,WACA,YACA,SACA,QACA,QACA,WACA,OACA,KACA,SACA,SACA,KACA,QACA,UACA,QACA,SACA,cACA,YACA,WACA,OACA,KACA,QACA,OACA,OACA,aACA,UACA,OACA,UACA,OACA,OACA,QACA,OACA,QACA,WACA,OACA,QACA,UACA,QACA,MACA,UACA,QACA,SACA,QACA,OACA,YACA,aACA,UACA,KACA,MACA,OACA,QACA,KACA,OACA,SACA,UACA,KACA,QACA,MACA,QACA,eACA,OACA,WACA,UACA,YACA,QACA,YACA,cACA,aACA,UACA,UACA,WACA,YACA,UACA,aACA,aACA,QACA,QACA,QACA,eACA,eACA,UACA,SACA,aACA,SACA,SACA,UACA,UACA,WACA,SACA,QACA,QACA,OACA,QACA,WACA,SACA,MACA,OACA,SACA,SACA,SACA,OACA,YACA,QACA,kBACA,eACA,OACA,OACA,SACA,OACA,OACA,SACA,QACA,aACA,SACA,WACA,SACA,SACA,YACA,QACA,SACA,gBACA,YACA,aACA,OACA,KACA,QACA,WACA,cACA,eACA,OACA,OACA,WACA,YACA,YACA,UACA,SACA,UACA,SACA,QACA,MACA,OACA,OACA,SACA,OAEA,UACA,YACA,WACA,WACA,UACA,cACA,OACA,WACA,aACA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2B,CAAC,MAAO,MACnCA,GAAAA,iBAAmB/Y,EA9WH,CACvB,MACA,MACA,WACA,QACA,MACA,MACA,QACA,KACA,aACA,aACA,KACA,SACA,gBACA,MACA,QACA,UACA,SACA,SACA,OACA,UACA,OACA,KACA,OACA,SACA,cACA,WACA,OACA,OACA,UACA,OACA,YACA,mBACA,cACA,QACA,OACA,QACA,WACA,UACA,UACA,SACA,SACA,YACA,UACA,aACA,UACA,OACA,gBACA,QACA,YACA,aACA,SACA,QACA,OACA,YACA,UACA,kBACA,eACA,kCACA,eACA,eACA,iBACA,eACA,oBACA,mCACA,eACA,SACA,QACA,OACA,MACA,aACA,MACA,UACA,UACA,UACA,SACA,aACA,QACA,WACA,gBACA,aACA,WACA,SACA,OACA,UACA,OACA,UACA,WACA,SACA,QACA,SACA,OACA,UACA,SACA,MACA,WACA,UACA,QACA,QACA,SACA,QACA,QACA,MACA,UACA,OACA,OACA,OACA,WACA,SACA,MACA,SACA,QACA,QACA,WACA,SACA,OACA,OACA,WACA,KACA,YACA,QACA,QACA,cACA,SACA,MACA,UACA,YACA,eACA,WACA,OACA,KACA,WACA,QACA,UACA,UACA,OACA,OACA,aACA,KACA,QACA,YACA,iBACA,QACA,QACA,MACA,SACA,QACA,SACA,MACA,SACA,MACA,WACA,SACA,QACA,WACA,WACA,UACA,QACA,QACA,MACA,KACA,OACA,YACA,MACA,OACA,SACA,UACA,oBACA,eACA,KACA,MACA,YACA,YACA,OACA,OACA,QACA,MACA,QACA,OACA,WACA,UACA,YACA,YACA,kBACA,kBACA,eACA,WACA,iBACA,QACA,YACA,UACA,UACA,YACA,QACA,OACA,QACA,OACA,YACA,MACA,aACA,cACA,YACA,YACA,aACA,iBACA,UACA,aACA,WACA,WACA,WACA,UACA,SACA,SACA,UACA,SACA,QACA,WACA,SACA,MACA,OACA,aACA,YACA,QACA,SACA,SACA,SACA,SACA,YACA,eACA,MACA,UACA,WACA,OACA,WACA,eACA,MACA,eACA,WACA,aACA,OACA,QACA,SACA,aACA,cACA,cACA,YACA,kBACA,MACA,YACA,SACA,cACA,QACA,cACA,OACA,OACA,YACA,gBACA,kBACA,KACA,WACA,YACA,kBACA,cACA,QACA,UACA,OACA,OACA,UACA,QACA,SACA,UACA,SACA,SACA,QACA,OACA,QACA,SACA,YACA,UACA,UACA,UACA,WACA,WACA,eACA,SACA,SACA,UACA,SAgFO+Y,GAAAA,YAAmC,CAAC,KAAM,KAAM,MAChDA,GAAAA,WAAa,CAAC,IAAK,QACnBA,GAAAA,SAAW,CAAC,IAAK,OACjBA,GAAAA,wBAA0B,CAAC,KAC3BA,GAAAA,sBAAwB,GACxBA,GAAAA,iBAAmB,CAAC,MACpBA,GAAAA,UAAY,GCrXrB,IAusCqBC,GAAAA,SAAAA,I,8xBAmBnB,WACE,OAAO,IAAIhT,EAAU,CACnB6B,iBAAkBmR,EAAcnR,iBAChCC,uBAAwBkR,EAAclR,uBACtCH,yBAA0BqR,EAAcrR,yBACxCI,uBAAwBiR,EAAcjR,uBACtCH,yBAA0BoR,EAAcpR,yBACxCjD,iBAAkBqU,EAAcrU,iBAChCM,YAAa+T,EAAc/T,YAC3BkD,WAAY6Q,EAAc7Q,WAC1BC,SAAU4Q,EAAc5Q,SACxBM,wBAAyBsQ,EAActQ,wBACvCG,sBAAuBmQ,EAAcnQ,sBACrCrC,iBAAkBwS,EAAcxS,iBAChC5B,iBAAkBoU,EAAcpU,iBAChCqD,UAAW+Q,EAAc/Q,iB,uEAlCV+Q,CAAsB7L,G,kxDAClC6L,GAAAA,iBA7NgB,CACvB,iCACA,gBACA,YACA,gBACA,aACA,qBACA,oBACA,eACA,gBACA,mBACA,aACA,cACA,WACA,iBACA,gBACA,qBACA,SACA,qBACA,oBACA,4BACA,2BACA,4BACA,kBACA,cACA,cACA,mBACA,sBACA,UACA,wBACA,oBACA,oBACA,0BACA,eACA,WACA,aACA,yBACA,yBACA,WACA,+BACA,0BACA,gBACA,gCACA,6BACA,eACA,YACA,aACA,oBACA,UACA,SACA,OACA,WACA,kBACA,iBACA,mBACA,WACA,qBACA,gBACA,aACA,uBACA,uBACA,oBACA,mBACA,yBACA,iBACA,eACA,UACA,YACA,mBACA,iBACA,oBACA,WACA,yBACA,0BACA,QACA,YACA,kBACA,wBACA,QACA,SACA,WACA,eACA,QACA,aACA,QACA,eACA,oBACA,UACA,SACA,qBACA,UACA,kBACA,qBACA,YACA,qBACA,mBACA,YACA,4BACA,QACA,oBACA,UACA,yBACA,2BACA,oBACA,gBACA,UACA,uBACA,qBACA,oBACA,qBACA,qBACA,6BACA,qBACA,SACA,SACA,aACA,OACA,QACA,WACA,OACA,SACA,uBACA,kBACA,sBACA,OACA,6BACA,WACA,eACA,6BACA,uBACA,cACA,UACA,qBACA,MACA,UACA,eACA,gBACA,eACA,YACA,gBACA,aACA,gBACA,qBACA,kBACA,iBACA,gBACA,UACA,QACA,iBACA,WACA,8BACA,UACA,iBACA,OACA,SACA,oBACA,OACA,OACA,iBACA,aACA,YACA,wBAEA,eACA,cACA,eACA,OACA,WACA,SACA,cACA,aACA,aACA,QACA,SACA,WACA,SACA,SACA,QACA,QA4COA,GAAAA,uBApCsB,CAE7B,YACA,gBACA,qBACA,QACA,YACA,iBACA,SACA,aACA,kBACA,QACA,YACA,iBAEA,OACA,aACA,YACA,kBACA,aACA,mBACA,YACA,kBACA,cAcOA,GAAAA,yBANwB,CAAC,OAAQ,QAOjCA,GAAAA,uBAAyB,CAAC,KAAM,SAChCA,GAAAA,yBAA2B,CAAC,MAAO,MACnCA,GAAAA,iBAAmBhZ,EAAO,GAAD,UAC3BZ,OAAOuH,OA9sCY,CACxBqM,UAAW,CACT,wBACA,MACA,eACA,QACA,YACA,WACA,cACA,MACA,MACA,QACA,SACA,MACA,MACA,QAEFiG,SAAU,CACR,YACA,cACA,MACA,aACA,OACA,kBACA,kBACA,eACA,gCACA,gCAEFC,cAAe,CACb,SACA,WACA,aACA,iBACA,oBACA,kBACA,cACA,YACA,cACA,eACA,gBACA,SACA,aACA,aAEF9F,WAAY,CAAC,OAAQ,UAAW,QAAS,WAAY,cAAe,aACpE+F,cAAe,CACb,aACA,kBACA,eACA,UACA,mBACA,mBACA,gBACA,eACA,0BACA,uBACA,sBACA,mBACA,gBACA,eACA,sBACA,YACA,kBACA,WACA,SACA,WACA,gBACA,aACA,iBACA,qBACA,yBAEFC,OAAQ,CAAC,gBAAiB,iBAAkB,iBAC5Cf,SAAU,CACR,aACA,gBACA,aACA,aACA,WACA,wBAEF/E,SAAU,CACR,cACA,oBACA,mBACA,sBACA,UACA,WACA,eACA,gBACA,WACA,WACA,qBACA,oBACA,0BACA,MACA,UACA,UACA,aACA,SACA,QACA,yBACA,eACA,cACA,oBACA,iBACA,gBACA,mBACA,OACA,OACA,SACA,aACA,aACA,eAEF+F,aAAc,CACZ,MACA,OACA,OACA,OACA,OACA,UACA,MACA,MACA,UACA,MACA,QACA,MACA,QACA,KACA,QACA,UACA,OACA,QACA,OACA,MACA,OACA,SACA,MACA,SACA,WACA,MACA,SAEFC,SAAU,CACR,WACA,WACA,eACA,eACA,mBACA,aACA,WACA,iBACA,qBACA,QACA,UACA,UACA,YACA,YACA,eACA,iBACA,oBACA,eACA,iBACA,0BACA,0BACA,YACA,oBACA,gBACA,iBACA,oBACA,YACA,cACA,qBACA,iBACA,mBACA,mBACA,YACA,YACA,cACA,iBACA,iBACA,aACA,UACA,YACA,gBAEFC,QAAS,CAAC,aAAc,QAAS,OAAQ,aAAc,wBACvDrF,SAAU,CACR,cACA,iBACA,eACA,wBACA,eACA,oBACA,YACA,gBACA,mBACA,gBACA,iBACA,cACA,aACA,aACA,eACA,kBACA,WACA,aACA,YACA,cACA,cACA,OACA,UACA,aAEF3T,OAAQ,CACN,QACA,OACA,YACA,SACA,YACA,aACA,SACA,OACA,MACA,QACA,QACA,QACA,WACA,YACA,UACA,YACA,UACA,QACA,QACA,UACA,QACA,MACA,aACA,gBACA,QACA,YACA,YACA,OACA,UACA,SAEFiZ,OAAQ,CACN,aACA,UACA,aACA,kBACA,aACA,cACA,kBACA,WACA,WACA,qBACA,eACA,qBACA,yBACA,aACA,aACA,gBACA,eACA,kBACA,iBACA,cACA,gBACA,qCACA,cACA,UACA,YACA,SACA,YACA,wBACA,QACA,kBACA,eACA,kBACA,cAEFC,YAAa,CACX,gBACA,aACA,SACA,YACA,cACA,kBACA,cACA,iBACA,eACA,gBACA,UACA,aAEF7B,QAAS,CAAC,kBAAmB,YAAa,oBAAqB,YAs6BzB5W,QAAO,SAAC6I,EAAK5J,GAAN,mBAAkB4J,GAAlB,GAA0B5J,MAAM,KAD7C,GAE3Bb,OAAOuH,OA75BW,CACvBqP,SAAU,CACR,MACA,MACA,QACA,MACA,MACA,KACA,MACA,gBACA,SACA,QACA,UACA,QACA,SACA,OACA,KACA,UACA,OACA,QACA,aACA,QACA,YACA,WACA,UACA,SACA,SACA,UACA,aACA,WACA,gBACA,WACA,UACA,SACA,QACA,UACA,eACA,eACA,oBACA,eACA,SACA,WACA,OACA,aACA,UACA,UACA,SACA,OACA,OACA,OACA,WACA,cACA,SACA,OACA,OACA,SACA,SACA,OACA,UACA,SACA,OACA,WACA,QACA,OACA,aACA,MACA,UACA,WACA,gBACA,OACA,OACA,WACA,OACA,QACA,QACA,SACA,WACA,WACA,cACA,kBACA,KACA,KACA,QACA,QACA,SACA,YACA,OACA,KACA,OACA,MACA,OACA,OACA,OACA,SACA,OACA,QACA,WACA,UACA,eACA,MACA,OACA,SACA,KACA,MACA,UACA,YACA,YACA,OACA,iBACA,YACA,aACA,UACA,SACA,KACA,QACA,QACA,OACA,UACA,QACA,OACA,YACA,UACA,QACA,OACA,YACA,SACA,YACA,OACA,WACA,cACA,aACA,cACA,UACA,WACA,SACA,SACA,SACA,QACA,WACA,WACA,aACA,OACA,OACA,SACA,gBACA,SACA,yBACA,iCACA,0BACA,eACA,MACA,UACA,WACA,OACA,aACA,cACA,QACA,cACA,WACA,OACA,KACA,MACA,OACA,cACA,UACA,WACA,cACA,UACA,QACA,SACA,UACA,SACA,aACA,MACA,OACA,SACA,UACA,OACA,UACA,QACA,QACA,OACA,eACA,aAEF0D,KAAM,CACJ,WACA,SACA,MACA,MACA,MACA,WACA,QACA,MACA,MACA,MACA,KACA,MACA,YACA,KACA,gBACA,MACA,QACA,UACA,MACA,aACA,OACA,KACA,UACA,WACA,OACA,OACA,UACA,OACA,YACA,mBACA,cACA,QACA,QACA,WACA,UACA,YACA,SACA,SACA,UACA,aACA,aACA,cACA,WACA,UACA,gBACA,QACA,SACA,QACA,UACA,eACA,eACA,oBACA,eACA,SACA,OACA,MACA,aACA,MACA,UACA,UACA,UACA,aACA,WACA,SACA,OACA,WACA,aACA,cACA,aACA,WACA,SACA,SACA,OACA,WACA,SACA,YACA,OACA,UACA,SACA,WACA,UACA,QACA,QACA,QACA,QACA,MACA,UACA,UACA,QACA,OACA,OACA,MACA,SACA,KACA,OACA,QACA,QACA,SACA,OACA,WACA,YACA,KACA,UACA,QACA,YACA,YACA,QACA,QACA,cACA,SACA,MACA,UACA,YACA,WACA,OACA,KACA,YACA,OACA,MACA,WACA,OACA,UACA,OACA,QACA,OACA,QACA,QACA,QACA,MACA,MACA,SACA,SACA,QACA,QACA,WACA,UACA,QACA,OACA,KACA,OACA,MACA,OACA,SACA,UACA,eACA,KACA,OACA,OACA,SACA,KACA,QACA,QACA,SACA,WACA,MACA,UACA,SACA,WACA,YACA,UACA,WACA,UACA,QACA,aACA,YACA,SACA,OACA,OACA,aACA,WACA,WACA,SACA,QACA,WACA,OACA,SACA,SACA,SACA,UACA,SACA,UACA,eACA,MACA,OACA,WACA,OACA,QACA,MACA,QACA,UACA,WACA,WACA,aACA,YACA,MACA,cACA,QACA,YACA,OACA,YACA,gBACA,kBACA,KACA,WACA,cACA,YACA,cACA,OACA,OACA,QACA,SACA,UACA,SACA,QACA,QACA,OACA,QACA,SACA,UACA,UACA,OACA,WACA,QACA,OACA,OACA,QACA,OACA,QAEFC,OAAQ,CACN,WACA,SACA,QACA,QACA,YACA,QACA,WACA,MACA,QACA,aACA,YACA,aACA,KACA,SACA,SACA,SACA,MACA,OACA,UACA,OACA,UACA,OACA,SACA,cACA,WACA,OACA,UACA,OACA,YACA,QACA,OACA,YACA,UACA,aACA,YACA,UACA,aACA,cACA,cACA,OACA,gBACA,YACA,aACA,OACA,YACA,kBACA,kCACA,eACA,eACA,iBACA,mCACA,QACA,OACA,OACA,MACA,MACA,UACA,aACA,WACA,QACA,QACA,WACA,aACA,UACA,aACA,gBACA,cACA,aACA,aACA,SACA,UACA,OACA,UACA,WACA,SACA,QACA,QACA,SACA,QACA,QACA,QACA,OACA,gBACA,SACA,UACA,MACA,SACA,KACA,WACA,OACA,OACA,OACA,SACA,YACA,YACA,aACA,YACA,QACA,QACA,MACA,UACA,eACA,WACA,YACA,UACA,WACA,QACA,OACA,UACA,UACA,OACA,QACA,aACA,QACA,KACA,QACA,YACA,iBACA,UACA,MACA,QACA,SACA,SACA,SACA,MACA,WACA,SACA,SACA,QACA,WACA,QACA,UACA,QACA,QACA,MACA,OACA,KACA,OACA,YACA,UACA,SACA,oBACA,MACA,OACA,YACA,aACA,MACA,SACA,UACA,MACA,YACA,aACA,UACA,YACA,OACA,kBACA,kBACA,eACA,iBACA,UACA,SACA,WACA,UACA,WACA,QACA,aACA,QACA,QACA,OACA,YACA,MACA,cACA,YACA,YACA,aACA,iBACA,UACA,aACA,WACA,WACA,WACA,WACA,UACA,SACA,UACA,OACA,SACA,UACA,MACA,OACA,YACA,QACA,SACA,SACA,SACA,UACA,YACA,WACA,UACA,OACA,UACA,OACA,WACA,QACA,WACA,eACA,MACA,eACA,WACA,aACA,QACA,QACA,YACA,SACA,aACA,cACA,YACA,cACA,kBACA,YACA,SACA,YACA,YACA,OACA,OACA,YACA,gBACA,kBACA,WACA,kBACA,cACA,QACA,OACA,UACA,QACA,UACA,SACA,QACA,QACA,QACA,UACA,WACA,UACA,WACA,WACA,eACA,SACA,SACA,UACA,OACA,QACA,SACA,gBACA,YACA,UACA,aACA,YACA,cACA,aACA,YACA,YACA,aACA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,E,uJAAA,8D,EAAA,E,qDAAA,IAAiC/P,QAEjC,SAAS8P,GAAe9U,GACtB,IAAKwU,GAAkBnP,SAASrF,EAAI2U,UAClC,MAAM,IAAII,GAAJ,mCAA4C/U,EAAI2U,WAGxD,GzB3DwE,iByB2D3D3U,EAAIkK,gBAAmBlK,EAAIkK,gBAAkB,EACxD,MAAM,IAAI6K,GAAY,oDAGxB,GAAI/U,EAAIjC,iBAAmB,EACzB,MAAM,IAAIgX,GAAJ,mEACwD/U,EAAIjC,gBAD5D,cAKR,GAA0B,WAAtBiC,EAAIiE,eAA8BjE,EAAI2H,QACxC,MAAM,IAAIoN,GACR,2EAIJ,OAAO/U,E","sources":["webpack://sqlFormatter/webpack/universalModuleDefinition","webpack://sqlFormatter/webpack/bootstrap","webpack://sqlFormatter/webpack/runtime/define property getters","webpack://sqlFormatter/webpack/runtime/hasOwnProperty shorthand","webpack://sqlFormatter/webpack/runtime/make namespace object","webpack://sqlFormatter/./src/utils.ts","webpack://sqlFormatter/./src/core/Indentation.ts","webpack://sqlFormatter/./src/core/token.ts","webpack://sqlFormatter/./src/core/InlineBlock.ts","webpack://sqlFormatter/./src/core/Params.ts","webpack://sqlFormatter/./src/core/regexFactory.ts","webpack://sqlFormatter/./src/core/Tokenizer.ts","webpack://sqlFormatter/./src/core/formatCommaPositions.ts","webpack://sqlFormatter/./src/core/tabularStyle.ts","webpack://sqlFormatter/./src/core/AliasAs.ts","webpack://sqlFormatter/./src/core/AsTokenFactory.ts","webpack://sqlFormatter/./src/core/Formatter.ts","webpack://sqlFormatter/./src/core/formatAliasPositions.ts","webpack://sqlFormatter/./src/languages/bigquery.formatter.ts","webpack://sqlFormatter/./src/languages/db2.formatter.ts","webpack://sqlFormatter/./src/languages/hive.formatter.ts","webpack://sqlFormatter/./src/languages/mariadb.formatter.ts","webpack://sqlFormatter/./src/languages/mysql.formatter.ts","webpack://sqlFormatter/./src/languages/n1ql.formatter.ts","webpack://sqlFormatter/./src/languages/plsql.formatter.ts","webpack://sqlFormatter/./src/languages/postgresql.formatter.ts","webpack://sqlFormatter/./src/languages/redshift.formatter.ts","webpack://sqlFormatter/./src/languages/sparksql.formatter.ts","webpack://sqlFormatter/./src/languages/standardsql.formatter.ts","webpack://sqlFormatter/./src/languages/tsql.formatter.ts","webpack://sqlFormatter/./src/sqlFormatter.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"sqlFormatter\"] = factory();\n\telse\n\t\troot[\"sqlFormatter\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export const dedupe = (arr: string[]) => [...new Set(arr)];\n\n// Only removes spaces, not newlines\nexport const trimSpacesEnd = (str: string) => str.replace(/[ \\t]+$/u, '');\n\n// Last element from array\nexport const last = <T extends any>(arr: T[]) => arr[arr.length - 1];\n\n// True array is empty, or it's not an array at all\nexport const isEmpty = (arr: any[]) => !Array.isArray(arr) || arr.length === 0;\n\n// Escapes regex special chars\nexport const escapeRegExp = (string: string) => string.replace(/[.*+?^${}()|[\\]\\\\]/gu, '\\\\$&');\n\n// Sorts strings by length, so that longer ones are first\n// Also sorts alphabetically after sorting by length.\nexport const sortByLengthDesc = (strings: string[]) =>\n strings.sort((a, b) => b.length - a.length || a.localeCompare(b));\n\n/** Get length of longest string in list of strings */\nexport const maxLength = (strings: string[]) =>\n strings.reduce((max, cur) => Math.max(max, cur.length), 0);\n\nexport const isNumber = (value: any): value is number => typeof value === 'number';\n","import { last } from '../utils';\n\nconst INDENT_TYPE_TOP_LEVEL = 'top-level';\nconst INDENT_TYPE_BLOCK_LEVEL = 'block-level';\n\n/**\n * Manages indentation levels.\n *\n * There are two types of indentation levels:\n *\n * - BLOCK_LEVEL : increased by open-parenthesis\n * - TOP_LEVEL : increased by RESERVED_COMMAND words\n */\nexport default class Indentation {\n private indentTypes: string[] = [];\n\n /**\n * @param {string} indent A string to indent with\n */\n constructor(private indent: string) {}\n\n /**\n * Returns indentation string for single indentation step.\n */\n getSingleIndent(): string {\n return this.indent;\n }\n\n /**\n * Returns current indentation string.\n * @return {string} indentation string based on indentTypes\n */\n getIndent(): string {\n return this.indent.repeat(this.indentTypes.length);\n }\n\n /**\n * Increases indentation by one top-level indent.\n */\n increaseTopLevel() {\n this.indentTypes.push(INDENT_TYPE_TOP_LEVEL);\n }\n\n /**\n * Increases indentation by one block-level indent.\n */\n increaseBlockLevel() {\n this.indentTypes.push(INDENT_TYPE_BLOCK_LEVEL);\n }\n\n /**\n * Decreases indentation by one top-level indent.\n * Does nothing when the previous indent is not top-level.\n */\n decreaseTopLevel() {\n if (this.indentTypes.length > 0 && last(this.indentTypes) === INDENT_TYPE_TOP_LEVEL) {\n this.indentTypes.pop();\n }\n }\n\n /**\n * Decreases indentation by one block-level indent.\n * If there are top-level indents within the block-level indent,\n * throws away these as well.\n */\n decreaseBlockLevel() {\n while (this.indentTypes.length > 0) {\n const type = this.indentTypes.pop();\n if (type !== INDENT_TYPE_TOP_LEVEL) {\n break;\n }\n }\n }\n\n /** Clears all indentation */\n resetIndentation() {\n this.indentTypes = [];\n }\n}\n","/** Token type enum for all possible Token categories */\nexport enum TokenType {\n WORD = 'WORD',\n STRING = 'STRING',\n RESERVED_KEYWORD = 'RESERVED_KEYWORD',\n RESERVED_LOGICAL_OPERATOR = 'RESERVED_LOGICAL_OPERATOR',\n RESERVED_DEPENDENT_CLAUSE = 'RESERVED_DEPENDENT_CLAUSE',\n RESERVED_BINARY_COMMAND = 'RESERVED_BINARY_COMMAND',\n RESERVED_COMMAND = 'RESERVED_COMMAND',\n RESERVED_JOIN_CONDITION = 'RESERVED_JOIN_CONDITION',\n OPERATOR = 'OPERATOR',\n BLOCK_START = 'BLOCK_START',\n BLOCK_END = 'BLOCK_END',\n LINE_COMMENT = 'LINE_COMMENT',\n BLOCK_COMMENT = 'BLOCK_COMMENT',\n NUMBER = 'NUMBER',\n PLACEHOLDER = 'PLACEHOLDER',\n EOF = 'EOF',\n}\n\n/** Struct to store the most basic cohesive unit of language grammar */\nexport interface Token {\n value: string;\n type: TokenType;\n key?: string;\n whitespaceBefore?: string;\n}\n\n/**\n * For use as a \"missing token\"\n * e.g. in lookAhead and lookBehind to avoid dealing with null values\n */\nexport const EOF_TOKEN = { type: TokenType.EOF, value: '«EOF»' };\n\n/** Special Unicode character to serve as a placeholder for tabular formats as \\w whitespace is unavailable */\nexport const ZWS = ''; // uses zero-width space (​ / U+200B)\nconst ZWS_REGEX = '\\u200b';\nconst spaces = `[${ZWS_REGEX}\\\\s]`;\n\n/** Checks if two tokens are equivalent */\nexport const testToken =\n (compareToken: Token) =>\n (token: Token): boolean =>\n token.type === compareToken.type &&\n new RegExp(`^${spaces}*${compareToken.value}${spaces}*$`, 'iu').test(token.value);\n\n/** Util object that allows for easy checking of Reserved Keywords */\nexport const isToken = {\n AS: testToken({ value: 'AS', type: TokenType.RESERVED_KEYWORD }),\n AND: testToken({ value: 'AND', type: TokenType.RESERVED_LOGICAL_OPERATOR }),\n BETWEEN: testToken({ value: 'BETWEEN', type: TokenType.RESERVED_KEYWORD }),\n CASE: testToken({ value: 'CASE', type: TokenType.BLOCK_START }),\n CAST: testToken({ value: 'CAST', type: TokenType.RESERVED_KEYWORD }),\n BY: testToken({ value: 'BY', type: TokenType.RESERVED_KEYWORD }),\n END: testToken({ value: 'END', type: TokenType.BLOCK_END }),\n FROM: testToken({ value: 'FROM', type: TokenType.RESERVED_COMMAND }),\n LIMIT: testToken({ value: 'LIMIT', type: TokenType.RESERVED_COMMAND }),\n SELECT: testToken({ value: 'SELECT', type: TokenType.RESERVED_COMMAND }),\n SET: testToken({ value: 'SET', type: TokenType.RESERVED_COMMAND }),\n TABLE: testToken({ value: 'TABLE', type: TokenType.RESERVED_KEYWORD }),\n WINDOW: testToken({ value: 'WINDOW', type: TokenType.RESERVED_COMMAND }),\n WITH: testToken({ value: 'WITH', type: TokenType.RESERVED_COMMAND }),\n};\n\n/** Checks if token is a Reserved Command or Reserved Binary Command */\nexport const isCommand = (token: Token): boolean =>\n token.type === TokenType.RESERVED_COMMAND || token.type === TokenType.RESERVED_BINARY_COMMAND;\n\n/** Checks if token is any Reserved Keyword or Command */\nexport const isReserved = (token: Token): boolean =>\n token.type === TokenType.RESERVED_KEYWORD ||\n token.type === TokenType.RESERVED_LOGICAL_OPERATOR ||\n token.type === TokenType.RESERVED_DEPENDENT_CLAUSE ||\n token.type === TokenType.RESERVED_JOIN_CONDITION ||\n token.type === TokenType.RESERVED_COMMAND ||\n token.type === TokenType.RESERVED_BINARY_COMMAND;\n","import { isToken, Token, TokenType } from './token';\n\n/**\n * Bookkeeper for inline blocks.\n *\n * Inline blocks are parenthesised expressions that are shorter than INLINE_MAX_LENGTH.\n * These blocks are formatted on a single line, unlike longer parenthesised\n * expressions where open-parenthesis causes newline and increase of indentation.\n */\nexport default class InlineBlock {\n level: number;\n expressionWidth: number;\n\n constructor(expressionWidth: number) {\n this.level = 0;\n this.expressionWidth = expressionWidth;\n }\n\n /**\n * Begins inline block when lookahead through upcoming tokens determines\n * that the block would be smaller than INLINE_MAX_LENGTH.\n * @param {Token[]} tokens Array of all tokens\n * @param {Number} index Current token position\n */\n beginIfPossible(tokens: Token[], index: number) {\n if (this.level === 0 && this.isInlineBlock(tokens, index)) {\n this.level = 1;\n } else if (this.level > 0) {\n this.level++;\n } else {\n this.level = 0;\n }\n }\n\n /**\n * Finishes current inline block.\n * There might be several nested ones.\n */\n end() {\n this.level--;\n }\n\n /**\n * True when inside an inline block\n */\n isActive(): boolean {\n return this.level > 0;\n }\n\n /**\n * Check if this should be an inline parentheses block\n * Examples are \"NOW()\", \"COUNT(*)\", \"int(10)\", key(`somecolumn`), DECIMAL(7,2)\n */\n isInlineBlock(tokens: Token[], index: number): boolean {\n let length = 0;\n let level = 0;\n\n for (let i = index; i < tokens.length; i++) {\n const token = tokens[i];\n length += token.value.length;\n\n if (this.isForbiddenToken(token)) {\n return false;\n }\n\n // Overran max length\n if (length > this.expressionWidth) {\n return false;\n }\n\n if (token.type === TokenType.BLOCK_START) {\n level++;\n } else if (token.type === TokenType.BLOCK_END) {\n level--;\n if (level === 0) {\n return true;\n }\n }\n }\n return false;\n }\n\n // Reserved words that cause newlines, comments and semicolons\n // are not allowed inside inline parentheses block\n isForbiddenToken({ type, value }: Token) {\n return (\n type === TokenType.RESERVED_COMMAND ||\n type === TokenType.RESERVED_LOGICAL_OPERATOR ||\n // type === TokenType.LINE_COMMENT ||\n type === TokenType.BLOCK_COMMENT ||\n value === ';' ||\n isToken.CASE({ type, value }) // CASE cannot have inline blocks\n );\n }\n}\n","import type { Token } from './token';\n\nexport type ParamItems = { [k: string]: string };\n\n/**\n * Handles placeholder replacement with given params.\n */\nexport default class Params {\n /**\n * @param {ParamItems} params\n */\n params: ParamItems | string[] | undefined;\n index: number;\n\n constructor(params: ParamItems | string[] | undefined) {\n this.params = params;\n this.index = 0;\n }\n\n /**\n * Returns param value that matches given placeholder with param key.\n * @param {Token} token\n * @return {string} param or token.value when params are missing\n */\n get({ key, value }: Token): string {\n if (!this.params) {\n return value;\n }\n\n if (key) {\n return (this.params as ParamItems)[key];\n }\n return (this.params as string[])[this.index++];\n }\n}\n","import { escapeRegExp, isEmpty, sortByLengthDesc } from '../utils';\n\n/**\n * Builds a RegExp containing all operators for a SQL dialect\n * @param {string} monadOperators - concatenated string of all 1-length operators\n * @param {string[]} polyadOperators - list of strings of all >1-length operators\n */\nexport const createOperatorRegex = (monadOperators: string, polyadOperators: string[]): RegExp =>\n new RegExp(\n `^(${sortByLengthDesc(polyadOperators).map(escapeRegExp).join('|')}|` +\n `[${monadOperators.split('').map(escapeRegExp).join('')}])`,\n 'u'\n );\n\n/**\n * Builds a RegExp for valid line comments in a SQL dialect\n * @param {string[]} lineCommentTypes - list of character strings that denote line comments\n */\nexport const createLineCommentRegex = (lineCommentTypes: string[]): RegExp =>\n new RegExp(\n `^((?:${lineCommentTypes.map(c => escapeRegExp(c)).join('|')}).*?)(?:\\r\\n|\\r|\\n|$)`,\n 'u'\n );\n\n/**\n * Builds a RegExp for all Reserved Keywords in a SQL dialect\n * @param {string[]} reservedKeywords - list of strings of all Reserved Keywords\n * @param {string} specialWordChars - concatenated string of all special chars that can appear in valid identifiers (and not in Reserved Keywords)\n */\nexport const createReservedWordRegex = (\n reservedKeywords: string[],\n specialWordChars: string = ''\n): RegExp => {\n if (reservedKeywords.length === 0) {\n return /^\\b$/u;\n }\n const reservedKeywordsPattern = sortByLengthDesc(reservedKeywords)\n .join('|')\n .replace(/ /gu, '\\\\s+');\n return new RegExp(\n `^(${reservedKeywordsPattern})(?![${escapeRegExp(specialWordChars)}]+)\\\\b`,\n 'iu'\n );\n};\n\n/**\n * Builds a RegExp for valid identifiers in a SQL dialect\n * @param {Object} specialChars\n * @param {string} specialChars.any - concatenated string of chars that can appear anywhere in a valid identifier\n * @param {string} specialChars.prefix - concatenated string of chars that only appear at the beginning of a valid identifier\n * @param {string} specialChars.suffix - concatenated string of chars that only appear at the end of a valid identifier\n */\nexport const createWordRegex = (\n specialChars: { any?: string; prefix?: string; suffix?: string } = {}\n): RegExp => {\n const prefixLookBehind = `[${escapeRegExp(specialChars.prefix ?? '')}]*`;\n const suffixLookAhead = `[${escapeRegExp(specialChars.suffix ?? '')}]*`;\n const unicodeWordChar =\n '\\\\p{Alphabetic}\\\\p{Mark}\\\\p{Decimal_Number}\\\\p{Connector_Punctuation}\\\\p{Join_Control}';\n const specialWordChars = `${escapeRegExp(specialChars.any ?? '')}`;\n\n const arrayAccessor = '\\\\[\\\\d\\\\]';\n const mapAccessor = `\\\\[['\"][${unicodeWordChar}]+['\"]\\\\]`;\n\n return new RegExp(\n `^((${prefixLookBehind}([${unicodeWordChar}${specialWordChars}]+)${suffixLookAhead})(${arrayAccessor}|${mapAccessor})?)`,\n 'u'\n );\n};\n\n// This enables the following string patterns:\n// 1. backtick quoted string using `` to escape\n// 2. square bracket quoted string (SQL Server) using ]] to escape\n// 3. double quoted string using \"\" or \\\" to escape\n// 4. single quoted string using '' or \\' to escape\n// 5. national character quoted string using N'' or N\\' to escape\n// 6. Unicode single-quoted string using \\' to escape\n// 7. Unicode double-quoted string using \\\" to escape\n// 8. PostgreSQL dollar-quoted strings\nconst patterns = {\n '``': '((`[^`]*($|`))+)',\n '{}': '((\\\\{[^\\\\}]*($|\\\\}))+)',\n '[]': '((\\\\[[^\\\\]]*($|\\\\]))(\\\\][^\\\\]]*($|\\\\]))*)',\n '\"\"': '((\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*(\"|$))+)',\n \"''\": \"(('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n \"N''\": \"((N'[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n \"x''\": \"(([xX]'[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n \"E''\": \"((E'[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n \"U&''\": \"((U&'[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*('|$))+)\",\n 'U&\"\"': '((U&\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*(\"|$))+)',\n '$$': '((?<tag>\\\\$\\\\w*\\\\$)[\\\\s\\\\S]*?(?:\\\\k<tag>|$))',\n};\nexport type StringPatternType = keyof typeof patterns;\n\n/**\n * Builds a string pattern for matching string patterns for all given string types\n * @param {StringPatternType[]} stringTypes - list of strings that denote string patterns\n */\nexport const createStringPattern = (stringTypes: StringPatternType[]): string =>\n stringTypes.map(t => patterns[t]).join('|');\n\n/**\n * Builds a RegExp for matching string patterns using `createStringPattern`\n * @param {StringPatternType[]} stringTypes - list of strings that denote string patterns\n */\nexport const createStringRegex = (stringTypes: StringPatternType[]): RegExp =>\n new RegExp('^(' + createStringPattern(stringTypes) + ')', 'u');\n\n/** Escapes paren characters for RegExp patterns */\nconst escapeParen = (paren: string): string => {\n if (paren.length === 1) {\n // A single punctuation character\n return escapeRegExp(paren);\n } else {\n // longer word\n return '\\\\b' + paren + '\\\\b';\n }\n};\n\n/**\n * Builds a RegExp for matching parenthesis patterns, escaping them with `escapeParen`\n * @param {string[]} parens - list of strings that denote parenthesis patterns\n */\nexport const createParenRegex = (parens: string[]): RegExp =>\n new RegExp('^(' + parens.map(escapeParen).join('|') + ')', 'iu');\n\n/**\n * Builds a RegExp for placeholder patterns\n * @param {string[]} types - list of strings that denote placeholder types\n * @param {string} pattern - string that denotes placeholder pattern\n */\nexport const createPlaceholderRegex = (types: string[], pattern: string): RegExp | undefined => {\n if (isEmpty(types)) {\n return undefined;\n }\n const typesRegex = types.map(escapeRegExp).join('|');\n\n return new RegExp(`^((?:${typesRegex})(?:${pattern}))`, 'u');\n};\n","import * as regexFactory from './regexFactory';\nimport { escapeRegExp } from '../utils';\nimport { Token, TokenType } from './token'; // convert to partial type import in TS 4.5\n\nexport const WHITESPACE_REGEX = /^(\\s+)/u;\nconst NULL_REGEX = /(?!)/; // zero-width negative lookahead, matches nothing\n\n/** Struct that defines how a SQL language can be broken into tokens */\ninterface TokenizerOptions {\n reservedKeywords: string[];\n reservedCommands: string[];\n reservedLogicalOperators: string[];\n reservedDependentClauses: string[];\n reservedBinaryCommands: string[];\n reservedJoinConditions: string[];\n stringTypes: regexFactory.StringPatternType[];\n blockStart: string[];\n blockEnd: string[];\n indexedPlaceholderTypes?: string[];\n namedPlaceholderTypes: string[];\n lineCommentTypes: string[];\n specialWordChars?: { prefix?: string; any?: string; suffix?: string };\n operators?: string[];\n}\n\n/** Converts SQL language string into a token stream */\nexport default class Tokenizer {\n REGEX_MAP: { [tokenType in TokenType]: RegExp };\n\n INDEXED_PLACEHOLDER_REGEX?: RegExp;\n IDENT_NAMED_PLACEHOLDER_REGEX?: RegExp;\n STRING_NAMED_PLACEHOLDER_REGEX?: RegExp;\n\n /**\n * @param {TokenizerOptions} cfg\n * @param {string[]} cfg.reservedKeywords - Reserved words in SQL\n * @param {string[]} cfg.reservedDependentClauses - Words that following a specific Statement and must have data attached\n * @param {string[]} cfg.reservedLogicalOperators - Words that are set to newline\n * @param {string[]} cfg.reservedCommands - Words that are set to new line separately\n * @param {string[]} cfg.reservedBinaryCommands - Words that are top level but have no indentation\n * @param {string[]} cfg.reservedJoinConditions - ON and USING\n * @param {string[]} cfg.stringTypes - string types to enable - \"\", '', ``, [], N''\n * @param {string[]} cfg.blockStart - Opening parentheses to enable, like (, [\n * @param {string[]} cfg.blockEnd - Closing parentheses to enable, like ), ]\n * @param {string[]} cfg.indexedPlaceholderTypes - Prefixes for indexed placeholders, like ?\n * @param {string[]} cfg.namedPlaceholderTypes - Prefixes for named placeholders, like @ and :\n * @param {string[]} cfg.lineCommentTypes - Line comments to enable, like # and --\n * @param {string[]} cfg.specialWordChars - Special chars that can be found inside of words, like @ and #\n * @param {string[]} cfg.operators - Additional operators to recognize\n */\n constructor(cfg: TokenizerOptions) {\n const specialWordCharsAll = Object.values(cfg.specialWordChars ?? {}).join('');\n this.REGEX_MAP = {\n [TokenType.WORD]: regexFactory.createWordRegex(cfg.specialWordChars),\n [TokenType.STRING]: regexFactory.createStringRegex(cfg.stringTypes),\n [TokenType.RESERVED_KEYWORD]: regexFactory.createReservedWordRegex(\n cfg.reservedKeywords,\n specialWordCharsAll\n ),\n [TokenType.RESERVED_DEPENDENT_CLAUSE]: regexFactory.createReservedWordRegex(\n cfg.reservedDependentClauses ?? [],\n specialWordCharsAll\n ),\n [TokenType.RESERVED_LOGICAL_OPERATOR]: regexFactory.createReservedWordRegex(\n cfg.reservedLogicalOperators,\n specialWordCharsAll\n ),\n [TokenType.RESERVED_COMMAND]: regexFactory.createReservedWordRegex(\n cfg.reservedCommands,\n specialWordCharsAll\n ),\n [TokenType.RESERVED_BINARY_COMMAND]: regexFactory.createReservedWordRegex(\n cfg.reservedBinaryCommands,\n specialWordCharsAll\n ),\n [TokenType.RESERVED_JOIN_CONDITION]: regexFactory.createReservedWordRegex(\n cfg.reservedJoinConditions,\n specialWordCharsAll\n ),\n [TokenType.OPERATOR]: regexFactory.createOperatorRegex('+-/*%&|^><=.,;[]{}`:$', [\n '<>',\n '<=',\n '>=',\n '!=',\n ...(cfg.operators ?? []),\n ]),\n [TokenType.BLOCK_START]: regexFactory.createParenRegex(cfg.blockStart),\n [TokenType.BLOCK_END]: regexFactory.createParenRegex(cfg.blockEnd),\n [TokenType.LINE_COMMENT]: regexFactory.createLineCommentRegex(cfg.lineCommentTypes),\n [TokenType.BLOCK_COMMENT]: /^(\\/\\*[^]*?(?:\\*\\/|$))/u,\n [TokenType.NUMBER]:\n /^(0x[0-9a-fA-F]+|0b[01]+|(-\\s*)?[0-9]+(\\.[0-9]*)?([eE][-+]?[0-9]+(\\.[0-9]+)?)?)/u,\n [TokenType.PLACEHOLDER]: NULL_REGEX, // matches nothing\n [TokenType.EOF]: NULL_REGEX, // matches nothing\n };\n\n this.INDEXED_PLACEHOLDER_REGEX = regexFactory.createPlaceholderRegex(\n cfg.indexedPlaceholderTypes ?? [],\n '[0-9]*'\n );\n this.IDENT_NAMED_PLACEHOLDER_REGEX = regexFactory.createPlaceholderRegex(\n cfg.namedPlaceholderTypes,\n '[a-zA-Z0-9._$]+'\n );\n this.STRING_NAMED_PLACEHOLDER_REGEX = regexFactory.createPlaceholderRegex(\n cfg.namedPlaceholderTypes,\n regexFactory.createStringPattern(cfg.stringTypes)\n );\n }\n\n /**\n * Takes a SQL string and breaks it into tokens.\n * Each token is an object with type and value.\n *\n * @param {string} input - The SQL string\n * @returns {Token[]} output token stream\n */\n tokenize(input: string): Token[] {\n const tokens: Token[] = [];\n let token: Token | undefined;\n\n // Keep processing the string until it is empty\n while (input.length) {\n // grab any preceding whitespace\n const whitespaceBefore = this.getWhitespace(input);\n input = input.substring(whitespaceBefore.length);\n\n if (input.length) {\n // Get the next token and the token type\n token = this.getNextToken(input, token);\n // Advance the string\n input = input.substring(token.value.length);\n\n tokens.push({ ...token, whitespaceBefore });\n }\n }\n return tokens;\n }\n\n /** Matches preceding whitespace if present */\n getWhitespace(input: string): string {\n const matches = input.match(WHITESPACE_REGEX);\n return matches ? matches[1] : '';\n }\n\n /** Curried function of `getTokenOnFirstMatch` that allows token type to be passed first */\n matchToken =\n (tokenType: TokenType) =>\n (input: string): Token | undefined =>\n this.getTokenOnFirstMatch({\n input,\n type: tokenType,\n regex: this.REGEX_MAP[tokenType],\n });\n\n /** Attempts to match next token from input string, tests RegExp patterns in decreasing priority */\n getNextToken(input: string, previousToken?: Token) {\n return (this.matchToken(TokenType.LINE_COMMENT)(input) ||\n this.matchToken(TokenType.BLOCK_COMMENT)(input) ||\n this.matchToken(TokenType.STRING)(input) ||\n this.matchToken(TokenType.BLOCK_START)(input) ||\n this.matchToken(TokenType.BLOCK_END)(input) ||\n this.getPlaceholderToken(input) ||\n this.matchToken(TokenType.NUMBER)(input) ||\n this.getReservedWordToken(input, previousToken) ||\n this.matchToken(TokenType.WORD)(input) ||\n this.matchToken(TokenType.OPERATOR)(input)) as Token;\n }\n\n /**\n * Attempts to match a placeholder token pattern\n * @return {Token | undefined} - The placeholder token if found, otherwise undefined\n */\n getPlaceholderToken(input: string): Token | undefined {\n const placeholderTokenRegexMap: { regex: RegExp; parseKey: (s: string) => string }[] = [\n // pattern for placeholder with identifier name\n {\n regex: this.IDENT_NAMED_PLACEHOLDER_REGEX ?? NULL_REGEX,\n parseKey: v => v.slice(1),\n },\n // pattern for placeholder with string name\n {\n regex: this.STRING_NAMED_PLACEHOLDER_REGEX ?? NULL_REGEX,\n parseKey: v =>\n this.getEscapedPlaceholderKey({ key: v.slice(2, -1), quoteChar: v.slice(-1) }),\n },\n // pattern for placeholder with numeric index\n {\n regex: this.INDEXED_PLACEHOLDER_REGEX ?? NULL_REGEX,\n parseKey: v => v.slice(1),\n },\n ];\n\n return placeholderTokenRegexMap.reduce((acc, { regex, parseKey }) => {\n const token = this.getTokenOnFirstMatch({ input, regex, type: TokenType.PLACEHOLDER });\n return token ? { ...token, key: parseKey(token.value) } : acc;\n }, undefined as Token | undefined);\n }\n\n getEscapedPlaceholderKey({ key, quoteChar }: { key: string; quoteChar: string }): string {\n return key.replace(new RegExp(escapeRegExp('\\\\' + quoteChar), 'gu'), quoteChar);\n }\n\n /**\n * Attempts to match a Reserved word token pattern, avoiding edge cases of Reserved words within string tokens\n * @return {Token | undefined} - The Reserved word token if found, otherwise undefined\n */\n getReservedWordToken(input: string, previousToken?: Token): Token | undefined {\n // A reserved word cannot be preceded by a '.'\n // this makes it so in \"mytable.from\", \"from\" is not considered a reserved word\n if (previousToken?.value === '.') {\n return undefined;\n }\n\n // prioritised list of Reserved token types\n const reservedTokenList = [\n TokenType.RESERVED_COMMAND,\n TokenType.RESERVED_BINARY_COMMAND,\n TokenType.RESERVED_DEPENDENT_CLAUSE,\n TokenType.RESERVED_LOGICAL_OPERATOR,\n TokenType.RESERVED_KEYWORD,\n TokenType.RESERVED_JOIN_CONDITION,\n ];\n\n return reservedTokenList.reduce(\n (matchedToken, tokenType) => matchedToken || this.matchToken(tokenType)(input),\n undefined as Token | undefined\n );\n }\n\n /**\n * Attempts to match RegExp from head of input, returning undefined if not found\n * @param {string} _.input - The string to match\n * @param {TokenType} _.type - The type of token to match against\n * @param {RegExp} _.regex - The regex to match\n * @return {Token | undefined} - The matched token if found, otherwise undefined\n */\n getTokenOnFirstMatch({\n input,\n type,\n regex,\n }: {\n input: string;\n type: TokenType;\n regex: RegExp;\n }): Token | undefined {\n const matches = input.match(regex);\n return matches ? ({ type, value: matches[1] } as Token) : undefined;\n }\n}\n","import { CommaPosition } from '../types';\nimport { maxLength } from '../utils';\nimport { WHITESPACE_REGEX } from './Tokenizer';\n\n/**\n * Handles comma placement - either before, after or tabulated\n */\nexport default function formatCommaPositions(\n query: string,\n commaPosition: CommaPosition,\n indent: string\n): string {\n return groupCommaDelimitedLines(query.split('\\n'))\n .flatMap(commaLines => {\n if (commaLines.length === 1) {\n return commaLines;\n } else if (commaPosition === 'tabular') {\n return formatTabular(commaLines);\n } else if (commaPosition === 'before') {\n return formatBefore(commaLines, indent);\n } else {\n throw new Error(`Unexpected commaPosition: ${commaPosition}`);\n }\n })\n .join('\\n');\n}\n\n/**\n * Given lines like this:\n *\n * [\n * 'SELECT',\n * ' foo,',\n * ' bar,',\n * ' baz',\n * 'FROM'\n * ]\n *\n * Returns groups like this:\n *\n * [\n * ['SELECT'],\n * [' foo,', ' bar,', ' baz'],\n * ['FROM']\n * ]\n */\nfunction groupCommaDelimitedLines(lines: string[]): string[][] {\n const groups: string[][] = [];\n for (let i = 0; i < lines.length; i++) {\n const group = [lines[i]];\n // when line ends with comma,\n // gather together all following lines that also end with comma,\n // plus one (which doesn't end with comma)\n while (lines[i].match(/.*,$/)) {\n i++;\n group.push(lines[i]);\n }\n groups.push(group);\n }\n return groups;\n}\n\n// makes all lines the same length by appending spaces before comma\nfunction formatTabular(commaLines: string[]): string[] {\n const maxLineLength = maxLength(commaLines);\n return trimTrailingCommas(commaLines).map((line, i) => {\n if (i === commaLines.length - 1) {\n return line; // do not add comma for last item\n }\n return line + ' '.repeat(maxLineLength - line.length - 1) + ',';\n });\n}\n\nfunction formatBefore(commaLines: string[], indent: string): string[] {\n return trimTrailingCommas(commaLines).map((line, i) => {\n if (i === 0) {\n return line; // do not add comma for first item\n }\n const [whitespace] = line.match(WHITESPACE_REGEX) || [''];\n return (\n removeLastIndent(whitespace, indent) +\n indent.replace(/ {2}$/, ', ') + // add comma to the end of last indent\n line.trimStart()\n );\n });\n}\n\nfunction removeLastIndent(whitespace: string, indent: string): string {\n return whitespace.replace(new RegExp(indent + '$'), '');\n}\n\nfunction trimTrailingCommas(lines: string[]): string[] {\n return lines.map(line => line.replace(/,$/, ''));\n}\n","import { IndentStyle } from '../types';\nimport { Token, ZWS } from './token';\n\n/**\n * When tabular style enabled,\n * produces a 10-char wide version of reserved token.\n *\n * It'll be padded by zero-width space characters\n * instead of normal spaces, so that these spaces will survive\n * trimming of spaces in other parts of formatter.\n * They'll be converted to normal spaces in the end of\n * all the normal formatting with the replaceTabularPlaceholders()\n */\nexport function toTabularToken(token: Token, indentStyle: IndentStyle): Token {\n if (indentStyle === 'standard') {\n return token;\n }\n\n let bufferItem = token.value; // store which part of keyword receives 10-space buffer\n let tail = [] as string[]; // rest of keyword\n if (bufferItem.length >= 10 && bufferItem.includes(' ')) {\n // split for long keywords like INNER JOIN or UNION DISTINCT\n [bufferItem, ...tail] = bufferItem.split(' ');\n }\n\n if (indentStyle === 'tabularLeft') {\n bufferItem = bufferItem.padEnd(9, ZWS);\n } else {\n bufferItem = bufferItem.padStart(9, ZWS);\n }\n\n return {\n ...token,\n value: bufferItem + ['', ...tail].join(' '),\n };\n}\n\n/**\n * Replaces zero-width-spaces added by the above function\n */\nexport function replaceTabularPlaceholders(query: string): string {\n return query.replace(new RegExp(ZWS, 'ugim'), ' ');\n}\n","import { AliasMode } from '../types';\nimport { isCommand, isToken, Token, TokenType } from './token';\n\nexport interface TokenStream {\n isWithinSelect(): boolean;\n getPreviousReservedToken(): Token;\n tokenLookBehind(n?: number): Token;\n tokenLookAhead(n?: number): Token;\n}\n\n/** Decides addition and removal of AS tokens */\nexport default class AliasAs {\n constructor(private aliasAs: AliasMode, private formatter: TokenStream) {}\n\n /** True when AS keyword should be added *before* current token */\n public shouldAddBefore(token: Token): boolean {\n return this.isMissingTableAlias(token) || this.isMissingSelectColumnAlias(token);\n }\n\n // if table alias is missing and should be added\n private isMissingTableAlias(token: Token): boolean {\n return (\n this.aliasAs === 'always' && token.type === TokenType.WORD && this.lookBehind().value === ')'\n );\n }\n\n // if select column alias is missing and should be added\n private isMissingSelectColumnAlias(token: Token): boolean {\n const prevToken = this.lookBehind();\n const nextToken = this.lookAhead();\n return (\n (this.aliasAs === 'always' || this.aliasAs === 'select') &&\n this.formatter.isWithinSelect() &&\n token.type === TokenType.WORD &&\n (isToken.END(prevToken) ||\n ((prevToken.type === TokenType.WORD || prevToken.type === TokenType.NUMBER) &&\n (nextToken.value === ',' || isCommand(nextToken))))\n );\n }\n\n /** True when AS keyword should be added *after* current token */\n public shouldAddAfter(): boolean {\n return this.isEdgeCaseCTE() || this.isEdgeCaseCreateTable() || this.isMissingTypeCastAs();\n }\n\n // checks for CAST(«expression» [AS] type)\n private isMissingTypeCastAs(): boolean {\n return (\n this.aliasAs === 'never' &&\n this.formatter.isWithinSelect() &&\n isToken.CAST(this.formatter.getPreviousReservedToken()) &&\n isToken.AS(this.lookAhead()) &&\n (this.lookAhead(2).type === TokenType.WORD ||\n this.lookAhead(2).type === TokenType.RESERVED_KEYWORD) &&\n this.lookAhead(3).value === ')'\n );\n }\n\n // checks for WITH `table` [AS] (\n private isEdgeCaseCTE(): boolean {\n const nextToken = this.lookAhead();\n return (\n this.aliasAs === 'never' &&\n isToken.WITH(this.lookBehind()) &&\n (nextToken.value === '(' || (isToken.AS(nextToken) && this.lookAhead(2).value === '('))\n );\n }\n\n // checks for CREATE TABLE `table` [AS] WITH (\n private isEdgeCaseCreateTable(): boolean {\n const prevToken = this.lookBehind();\n const nextToken = this.lookAhead();\n return (\n this.aliasAs === 'never' &&\n (isToken.TABLE(prevToken) || prevToken.value.endsWith('TABLE')) &&\n (isToken.WITH(nextToken) || (isToken.AS(nextToken) && isToken.WITH(this.lookAhead(2))))\n );\n }\n\n /* True when the current AS token should be discarded */\n public shouldRemove(): boolean {\n return this.aliasAs === 'never' || (this.aliasAs === 'select' && this.isRemovableNonSelectAs());\n }\n\n private isRemovableNonSelectAs(): boolean {\n return (\n this.lookBehind().value === ')' && // ) [AS] alias but not SELECT (a) [AS] alpha\n !this.formatter.isWithinSelect() &&\n this.lookAhead().value !== '(' // skip WITH foo [AS] ( ...\n );\n }\n\n private lookBehind(n?: number): Token {\n return this.formatter.tokenLookBehind(n);\n }\n\n private lookAhead(n?: number): Token {\n return this.formatter.tokenLookAhead(n);\n }\n}\n","import { KeywordCase } from '../types';\nimport { isToken, Token, TokenType } from './token';\n\nexport default class AsTokenFactory {\n private detectedCase: KeywordCase;\n\n constructor(private keywordCase: KeywordCase, tokens: Token[] = []) {\n this.detectedCase = this.autoDetectCase(tokens);\n }\n\n private autoDetectCase(tokens: Token[]) {\n const asTokens = tokens.filter(isToken.AS);\n const upperAsTokens = asTokens.filter(({ value }) => value === 'AS');\n return upperAsTokens.length > asTokens.length / 2 ? 'upper' : 'lower';\n }\n\n /** Returns AS token with either upper- or lowercase text */\n public token(): Token {\n return {\n type: TokenType.RESERVED_KEYWORD,\n value: this.asTokenValue(),\n };\n }\n\n private asTokenValue(): 'AS' | 'as' {\n const keywordCase = this.keywordCase === 'preserve' ? this.detectedCase : this.keywordCase;\n return keywordCase === 'upper' ? 'AS' : 'as';\n }\n}\n","import Indentation from './Indentation';\nimport InlineBlock from './InlineBlock';\nimport Params from './Params';\nimport { trimSpacesEnd } from '../utils';\nimport { isReserved, isCommand, isToken, Token, TokenType, EOF_TOKEN } from './token';\nimport Tokenizer from './Tokenizer';\nimport { FormatOptions } from '../types';\nimport formatCommaPositions from './formatCommaPositions';\nimport formatAliasPositions from './formatAliasPositions';\nimport { toTabularToken, replaceTabularPlaceholders } from './tabularStyle';\nimport AliasAs from './AliasAs';\nimport AsTokenFactory from './AsTokenFactory';\n\n/** Main formatter class that produces a final output string from list of tokens */\nexport default class Formatter {\n private cfg: FormatOptions;\n private indentation: Indentation;\n private inlineBlock: InlineBlock;\n private aliasAs: AliasAs;\n private params: Params;\n private asTokenFactory: AsTokenFactory;\n\n private currentNewline = true;\n private previousReservedToken: Token = EOF_TOKEN;\n private previousCommandToken: Token = EOF_TOKEN;\n protected tokens: Token[] = [];\n protected index = -1;\n\n constructor(cfg: FormatOptions) {\n this.cfg = cfg;\n this.indentation = new Indentation(this.indentString());\n this.inlineBlock = new InlineBlock(this.cfg.expressionWidth);\n this.aliasAs = new AliasAs(this.cfg.aliasAs, this);\n this.params = new Params(this.cfg.params);\n this.asTokenFactory = new AsTokenFactory(this.cfg.keywordCase);\n }\n\n private indentString(): string {\n if (this.isTabularStyle()) {\n return ' '.repeat(10);\n }\n if (this.cfg.useTabs) {\n return '\\t';\n }\n return ' '.repeat(this.cfg.tabWidth);\n }\n\n /**\n * SQL Tokenizer for this formatter, provided by subclasses.\n */\n protected tokenizer(): Tokenizer {\n throw new Error('tokenizer() not implemented by subclass');\n }\n\n /**\n * Reprocess and modify a token based on parsed context.\n * Subclasses can override this to modify tokens during formatting.\n * @param {Token} token - The token to modify\n * @return {Token} new token or the original\n */\n protected tokenOverride(token: Token): Token {\n return token;\n }\n\n /**\n * Formats an SQL query.\n * @param {string} query - The SQL query string to be formatted\n * @return {string} The formatter query\n */\n public format(query: string): string {\n this.tokens = this.tokenizer().tokenize(query);\n this.asTokenFactory = new AsTokenFactory(this.cfg.keywordCase, this.tokens);\n const formattedQuery = this.getFormattedQueryFromTokens();\n const finalQuery = this.postFormat(formattedQuery);\n\n return finalQuery.replace(/^\\n*/u, '').trimEnd();\n }\n\n /**\n * Does post-processing on the formatted query.\n */\n private postFormat(query: string): string {\n if (this.cfg.tabulateAlias) {\n query = formatAliasPositions(query);\n }\n if (this.cfg.commaPosition === 'before' || this.cfg.commaPosition === 'tabular') {\n query = formatCommaPositions(query, this.cfg.commaPosition, this.indentString());\n }\n\n return query;\n }\n\n /**\n * Performs main construction of query from token list, delegates to other methods for formatting based on token criteria\n */\n private getFormattedQueryFromTokens(): string {\n let formattedQuery = '';\n\n for (this.index = 0; this.index < this.tokens.length; this.index++) {\n let token = this.tokenOverride(this.tokens[this.index]);\n\n // if token is a Reserved Keyword, Command, Binary Command, Dependent Clause, Logical Operator\n if (isReserved(token)) {\n this.previousReservedToken = token;\n if (\n token.type !== TokenType.RESERVED_KEYWORD &&\n token.type !== TokenType.RESERVED_JOIN_CONDITION\n ) {\n // convert Reserved Command or Logical Operator to tabular format if needed\n token = toTabularToken(token, this.cfg.indentStyle);\n }\n if (token.type === TokenType.RESERVED_COMMAND) {\n this.previousCommandToken = token;\n }\n }\n\n if (token.type === TokenType.LINE_COMMENT) {\n formattedQuery = this.formatLineComment(token, formattedQuery);\n } else if (token.type === TokenType.BLOCK_COMMENT) {\n formattedQuery = this.formatBlockComment(token, formattedQuery);\n } else if (token.type === TokenType.RESERVED_COMMAND) {\n this.currentNewline = this.checkNewline(token);\n formattedQuery = this.formatCommand(token, formattedQuery);\n } else if (token.type === TokenType.RESERVED_BINARY_COMMAND) {\n formattedQuery = this.formatBinaryCommand(token, formattedQuery);\n } else if (token.type === TokenType.RESERVED_DEPENDENT_CLAUSE) {\n formattedQuery = this.formatDependentClause(token, formattedQuery);\n } else if (token.type === TokenType.RESERVED_JOIN_CONDITION) {\n formattedQuery = this.formatJoinCondition(token, formattedQuery);\n } else if (token.type === TokenType.RESERVED_LOGICAL_OPERATOR) {\n formattedQuery = this.formatLogicalOperator(token, formattedQuery);\n } else if (token.type === TokenType.RESERVED_KEYWORD) {\n formattedQuery = this.formatKeyword(token, formattedQuery);\n } else if (token.type === TokenType.BLOCK_START) {\n formattedQuery = this.formatBlockStart(token, formattedQuery);\n } else if (token.type === TokenType.BLOCK_END) {\n formattedQuery = this.formatBlockEnd(token, formattedQuery);\n } else if (token.type === TokenType.PLACEHOLDER) {\n formattedQuery = this.formatPlaceholder(token, formattedQuery);\n } else if (token.type === TokenType.OPERATOR) {\n formattedQuery = this.formatOperator(token, formattedQuery);\n } else {\n formattedQuery = this.formatWord(token, formattedQuery);\n }\n }\n return replaceTabularPlaceholders(formattedQuery);\n }\n\n /**\n * Formats word tokens + any potential AS tokens for aliases\n */\n private formatWord(token: Token, query: string): string {\n let finalQuery = query;\n if (this.aliasAs.shouldAddBefore(token)) {\n finalQuery = this.formatWithSpaces(this.asTokenFactory.token(), finalQuery);\n }\n\n finalQuery = this.formatWithSpaces(token, finalQuery);\n\n if (this.aliasAs.shouldAddAfter()) {\n finalQuery = this.formatWithSpaces(this.asTokenFactory.token(), finalQuery);\n }\n\n return finalQuery;\n }\n\n /**\n * Checks if a newline should currently be inserted\n */\n private checkNewline(token: Token): boolean {\n const nextTokens = this.tokensUntilNextCommandOrQueryEnd();\n\n // auto break if SELECT includes CASE statements\n if (this.isWithinSelect() && nextTokens.some(isToken.CASE)) {\n return true;\n }\n\n switch (this.cfg.multilineLists) {\n case 'always':\n return true;\n case 'avoid':\n return false;\n case 'expressionWidth':\n return this.inlineWidth(token, nextTokens) > this.cfg.expressionWidth;\n default: // multilineLists mode is a number\n return (\n this.countClauses(nextTokens) > this.cfg.multilineLists ||\n this.inlineWidth(token, nextTokens) > this.cfg.expressionWidth\n );\n }\n }\n\n private inlineWidth(token: Token, tokens: Token[]): number {\n const tokensString = tokens.map(({ value }) => (value === ',' ? value + ' ' : value)).join('');\n return `${token.whitespaceBefore}${token.value} ${tokensString}`.length;\n }\n\n /**\n * Counts comma-separated clauses (doesn't count commas inside blocks)\n * Note: There's always at least one clause.\n */\n private countClauses(tokens: Token[]): number {\n let count = 1;\n let openBlocks = 0;\n for (const { type, value } of tokens) {\n if (value === ',' && openBlocks === 0) {\n count++;\n }\n if (type === TokenType.BLOCK_START) {\n openBlocks++;\n }\n if (type === TokenType.BLOCK_END) {\n openBlocks--;\n }\n }\n return count;\n }\n\n /** get all tokens between current token and next Reserved Command or query end */\n private tokensUntilNextCommandOrQueryEnd(): Token[] {\n const tail = this.tokens.slice(this.index + 1);\n return tail.slice(\n 0,\n tail.length ? tail.findIndex(token => isCommand(token) || token.value === ';') : undefined\n );\n }\n\n /** Formats a line comment onto query */\n private formatLineComment(token: Token, query: string): string {\n return this.addNewline(query + this.show(token));\n }\n\n /** Formats a block comment onto query */\n private formatBlockComment(token: Token, query: string): string {\n return this.addNewline(this.addNewline(query) + this.indentComment(token.value));\n }\n\n /** Aligns comment to current indentation level */\n private indentComment(comment: string): string {\n return comment.replace(/\\n[ \\t]*/gu, '\\n' + this.indentation.getIndent() + ' ');\n }\n\n /**\n * Formats a Reserved Command onto query, increasing indentation level where necessary\n */\n private formatCommand(token: Token, query: string): string {\n this.indentation.decreaseTopLevel();\n\n query = this.addNewline(query);\n\n // indent tabular formats, except when preceding a (\n if (this.isTabularStyle()) {\n if (this.tokenLookAhead().value !== '(') {\n this.indentation.increaseTopLevel();\n }\n } else {\n this.indentation.increaseTopLevel();\n }\n\n query += this.equalizeWhitespace(this.show(token)); // print token onto query\n if (this.currentNewline && !this.isTabularStyle()) {\n query = this.addNewline(query);\n } else {\n query += ' ';\n }\n return query;\n }\n\n /**\n * Formats a Reserved Binary Command onto query, joining neighbouring tokens\n */\n private formatBinaryCommand(token: Token, query: string): string {\n const isJoin = /JOIN/i.test(token.value); // check if token contains JOIN\n if (!isJoin || this.isTabularStyle()) {\n // decrease for boolean set operators or in tabular mode\n this.indentation.decreaseTopLevel();\n }\n query = this.addNewline(query) + this.equalizeWhitespace(this.show(token));\n return isJoin ? query + ' ' : this.addNewline(query);\n }\n\n /**\n * Formats a Reserved Keyword onto query, skipping AS if disabled\n */\n private formatKeyword(token: Token, query: string): string {\n if (isToken.AS(token) && this.aliasAs.shouldRemove()) {\n return query;\n }\n\n return this.formatWithSpaces(token, query);\n }\n\n /**\n * Formats a Reserved Dependent Clause token onto query, supporting the keyword that precedes it\n */\n private formatDependentClause(token: Token, query: string): string {\n return this.addNewline(query) + this.equalizeWhitespace(this.show(token)) + ' ';\n }\n\n // Formats ON and USING keywords\n private formatJoinCondition(token: Token, query: string): string {\n return query + this.equalizeWhitespace(this.show(token)) + ' ';\n }\n\n /**\n * Formats an Operator onto query, following rules for specific characters\n */\n private formatOperator(token: Token, query: string): string {\n // special operator\n if (token.value === ',') {\n return this.formatComma(token, query);\n } else if (token.value === ';') {\n return this.formatQuerySeparator(token, query);\n } else if (['$', '['].includes(token.value)) {\n return this.formatWithSpaces(token, query, 'before');\n } else if ([':', ']'].includes(token.value)) {\n return this.formatWithSpaces(token, query, 'after');\n } else if (['.', '{', '}', '`'].includes(token.value)) {\n return this.formatWithoutSpaces(token, query);\n }\n\n // regular operator\n if (this.cfg.denseOperators && this.tokenLookBehind().type !== TokenType.RESERVED_COMMAND) {\n // do not trim whitespace if SELECT *\n return this.formatWithoutSpaces(token, query);\n }\n return this.formatWithSpaces(token, query);\n }\n\n /**\n * Formats a Logical Operator onto query, joining boolean conditions\n */\n private formatLogicalOperator(token: Token, query: string): string {\n // ignore AND when BETWEEN x [AND] y\n if (isToken.AND(token) && isToken.BETWEEN(this.tokenLookBehind(2))) {\n return this.formatWithSpaces(token, query);\n }\n\n if (this.isTabularStyle()) {\n this.indentation.decreaseTopLevel();\n }\n\n if (this.cfg.logicalOperatorNewline === 'before') {\n return (\n (this.currentNewline ? this.addNewline(query) : query) +\n this.equalizeWhitespace(this.show(token)) +\n ' '\n );\n } else {\n query += this.show(token);\n return this.currentNewline ? this.addNewline(query) : query;\n }\n }\n\n /** Replace any sequence of whitespace characters with single space */\n private equalizeWhitespace(string: string): string {\n return string.replace(/\\s+/gu, ' ');\n }\n\n /**\n * Formats a Block Start token (left paren/bracket/brace, CASE) onto query, beginning an Inline Block or increasing indentation where necessary\n */\n private formatBlockStart(token: Token, query: string): string {\n if (isToken.CASE(token)) {\n query = this.formatWithSpaces(token, query);\n } else {\n // Take out the preceding space unless there was whitespace there in the original query\n // or another opening parens or line comment\n const preserveWhitespaceFor = [\n TokenType.BLOCK_START,\n TokenType.LINE_COMMENT,\n TokenType.OPERATOR,\n ];\n if (\n token.whitespaceBefore?.length === 0 &&\n !preserveWhitespaceFor.includes(this.tokenLookBehind().type)\n ) {\n query = trimSpacesEnd(query);\n } else if (!this.cfg.newlineBeforeOpenParen) {\n query = query.trimEnd() + ' ';\n }\n query += this.show(token);\n this.inlineBlock.beginIfPossible(this.tokens, this.index);\n }\n\n if (!this.inlineBlock.isActive()) {\n this.indentation.increaseBlockLevel();\n if (!isToken.CASE(token) || this.cfg.multilineLists === 'always') {\n query = this.addNewline(query);\n }\n }\n return query;\n }\n\n /**\n * Formats a Block End token (right paren/bracket/brace, END) onto query, closing an Inline Block or decreasing indentation where necessary\n */\n private formatBlockEnd(token: Token, query: string): string {\n if (this.inlineBlock.isActive()) {\n this.inlineBlock.end();\n if (isToken.END(token)) {\n return this.formatWithSpaces(token, query); // add space before END when closing inline block\n }\n return this.formatWithSpaces(token, query, 'after'); // do not add space before )\n } else {\n this.indentation.decreaseBlockLevel();\n\n if (this.isTabularStyle()) {\n // +1 extra indentation step for the closing paren\n query = this.addNewline(query) + this.indentation.getSingleIndent();\n } else if (this.cfg.newlineBeforeCloseParen) {\n query = this.addNewline(query);\n } else {\n query = query.trimEnd() + ' ';\n }\n\n return this.formatWithSpaces(token, query);\n }\n }\n\n /**\n * Formats a Placeholder item onto query, to be replaced with the value of the placeholder\n */\n formatPlaceholder(token: Token, query: string): string {\n return query + this.params.get(token) + ' ';\n }\n\n /**\n * Formats a comma Operator onto query, ending line unless in an Inline Block\n */\n private formatComma(token: Token, query: string): string {\n query = trimSpacesEnd(query) + this.show(token) + ' ';\n\n if (this.inlineBlock.isActive()) {\n return query;\n } else if (isToken.LIMIT(this.getPreviousReservedToken())) {\n return query;\n } else if (this.currentNewline) {\n return this.addNewline(query);\n } else {\n return query;\n }\n }\n\n /** Simple append of token onto query */\n private formatWithoutSpaces(token: Token, query: string): string {\n return trimSpacesEnd(query) + this.show(token);\n }\n\n /**\n * Add token onto query with spaces - either before, after, or both\n */\n private formatWithSpaces(\n token: Token,\n query: string,\n addSpace: 'before' | 'after' | 'both' = 'both'\n ): string {\n const before = addSpace === 'after' ? trimSpacesEnd(query) : query;\n const after = addSpace === 'before' ? '' : ' ';\n return before + this.show(token) + after;\n }\n\n private formatQuerySeparator(token: Token, query: string): string {\n this.indentation.resetIndentation();\n return [\n trimSpacesEnd(query),\n this.cfg.newlineBeforeSemicolon ? '\\n' : '',\n this.show(token),\n '\\n'.repeat(this.cfg.linesBetweenQueries + 1),\n ].join('');\n }\n\n /** Converts token to string, uppercasing if enabled */\n private show(token: Token): string {\n if (\n isReserved(token) ||\n token.type === TokenType.BLOCK_START ||\n token.type === TokenType.BLOCK_END\n ) {\n switch (this.cfg.keywordCase) {\n case 'preserve':\n return token.value;\n case 'upper':\n return token.value.toUpperCase();\n case 'lower':\n return token.value.toLowerCase();\n }\n } else {\n return token.value;\n }\n }\n\n /** Inserts a newline onto the query */\n private addNewline(query: string): string {\n query = trimSpacesEnd(query);\n if (!query.endsWith('\\n')) {\n query += '\\n';\n }\n return query + this.indentation.getIndent();\n }\n\n private isTabularStyle(): boolean {\n return this.cfg.indentStyle === 'tabularLeft' || this.cfg.indentStyle === 'tabularRight';\n }\n\n /** Returns the latest encountered reserved keyword token */\n public getPreviousReservedToken(): Token {\n return this.previousReservedToken;\n }\n\n /** True when currently within SELECT command */\n public isWithinSelect(): boolean {\n return isToken.SELECT(this.previousCommandToken);\n }\n\n /** Fetches nth previous token from the token stream */\n public tokenLookBehind(n = 1): Token {\n return this.tokens[this.index - n] || EOF_TOKEN;\n }\n\n /** Fetches nth next token from the token stream */\n public tokenLookAhead(n = 1): Token {\n return this.tokens[this.index + n] || EOF_TOKEN;\n }\n}\n","import { maxLength } from '../utils';\n\n/**\n * Handles select alias placement - tabulates if enabled\n */\nexport default function formatAliasPositions(query: string): string {\n const lines = query.split('\\n');\n\n let newQuery: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n // find SELECT rows with trailing comma, if no comma (only one row) - no-op\n if (lines[i].match(/^\\s*SELECT/i)) {\n let aliasLines: string[] = [];\n if (lines[i].match(/.*,$/)) {\n aliasLines = [lines[i]]; // add select to aliasLines in case of tabular formats\n } else {\n newQuery.push(lines[i]); // add select to new query\n if (lines[i].match(/^\\s*SELECT\\s+.+(?!,$)/i)) {\n continue;\n }\n aliasLines.push(lines[++i]);\n }\n\n // get all lines in SELECT clause\n while (lines[i++].match(/.*,$/)) {\n aliasLines.push(lines[i]);\n }\n\n // break lines into alias with optional AS, and all preceding text\n const splitLines = aliasLines\n .map(line => ({ line, matches: line.match(/(^.*?\\S) (AS )?(\\S+,?$)/i) }))\n .map(({ line, matches }) => {\n if (!matches) {\n return { precedingText: line };\n }\n return {\n precedingText: matches[1],\n as: matches[2],\n alias: matches[3],\n };\n });\n\n // get longest of precedingText, trim trailing comma for non-alias columns\n const aliasMaxLength = maxLength(\n splitLines.map(({ precedingText }) => precedingText.replace(/\\s*,\\s*$/, ''))\n );\n // re-construct line, aligning by inserting space before AS or alias\n aliasLines = splitLines.map(\n ({ precedingText, as, alias }) =>\n precedingText +\n (alias ? ' '.repeat(aliasMaxLength - precedingText.length + 1) + (as ?? '') + alias : '')\n );\n newQuery = [...newQuery, ...aliasLines];\n }\n newQuery.push(lines[i]);\n }\n\n return newQuery.join('\\n');\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { Token } from '../core/token';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\nconst reservedFunctions = {\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/aead_encryption_functions\n aead: [\n 'KEYS.NEW_KEYSET',\n 'KEYS.ADD_KEY_FROM_RAW_BYTES',\n 'AEAD.DECRYPT_BYTES',\n 'AEAD.DECRYPT_STRING',\n 'AEAD.ENCRYPT',\n 'KEYS.KEYSET_CHAIN',\n 'KEYS.KEYSET_FROM_JSON',\n 'KEYS.KEYSET_TO_JSON',\n 'KEYS.ROTATE_KEYSET',\n 'KEYS.KEYSET_LENGTH',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_analytic_functions\n aggregateAnalytic: [\n 'ANY_VALUE',\n 'ARRAY_AGG',\n 'AVG',\n 'CORR',\n 'COUNT',\n 'COUNTIF',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'MAX',\n 'MIN',\n 'ST_CLUSTERDBSCAN',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'STRING_AGG',\n 'SUM',\n 'VAR_POP',\n 'VAR_SAMP',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions\n aggregate: [\n 'ANY_VALUE',\n 'ARRAY_AGG',\n 'ARRAY_CONCAT_AGG',\n 'AVG',\n 'BIT_AND',\n 'BIT_OR',\n 'BIT_XOR',\n 'COUNT',\n 'COUNTIF',\n 'LOGICAL_AND',\n 'LOGICAL_OR',\n 'MAX',\n 'MIN',\n 'STRING_AGG',\n 'SUM',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/approximate_aggregate_functions\n approximateAggregate: [\n 'APPROX_COUNT_DISTINCT',\n 'APPROX_QUANTILES',\n 'APPROX_TOP_COUNT',\n 'APPROX_TOP_SUM',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions\n array: [\n 'ARRAY',\n 'ARRAY_CONCAT',\n 'ARRAY_LENGTH',\n 'ARRAY_TO_STRING',\n 'GENERATE_ARRAY',\n 'GENERATE_DATE_ARRAY',\n 'GENERATE_TIMESTAMP_ARRAY',\n 'ARRAY_REVERSE',\n 'OFFSET',\n 'SAFE_OFFSET',\n 'ORDINAL',\n 'SAFE_ORDINAL',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/bit_functions\n bitwise: ['BIT_COUNT'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions\n conversion: ['CASE', 'PARSE_BIGNUMERIC', 'PARSE_NUMERIC', 'SAFE_CAST'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions\n date: [\n 'CURRENT_DATE',\n 'EXTRACT',\n 'DATE',\n 'DATE_ADD',\n 'DATE_SUB',\n 'DATE_DIFF',\n 'DATE_TRUNC',\n 'DATE_FROM_UNIX_DATE',\n 'FORMAT_DATE',\n 'LAST_DAY',\n 'PARSE_DATE',\n 'UNIX_DATE',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/datetime_functions\n datetime: [\n 'CURRENT_DATETIME',\n 'DATETIME',\n 'EXTRACT',\n 'DATETIME_ADD',\n 'DATETIME_SUB',\n 'DATETIME_DIFF',\n 'DATETIME_TRUNC',\n 'FORMAT_DATETIME',\n 'LAST_DAY',\n 'PARSE_DATETIME',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging_functions\n debugging: ['ERROR'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/federated_query_functions\n federatedQuery: ['EXTERNAL_QUERY'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions\n geography: [\n 'S2_CELLIDFROMPOINT',\n 'S2_COVERINGCELLIDS',\n 'ST_ANGLE',\n 'ST_AREA',\n 'ST_ASBINARY',\n 'ST_ASGEOJSON',\n 'ST_ASTEXT',\n 'ST_AZIMUTH',\n 'ST_BOUNDARY',\n 'ST_BOUNDINGBOX',\n 'ST_BUFFER',\n 'ST_BUFFERWITHTOLERANCE',\n 'ST_CENTROID',\n 'ST_CENTROID_AGG',\n 'ST_CLOSESTPOINT',\n 'ST_CLUSTERDBSCAN',\n 'ST_CONTAINS',\n 'ST_CONVEXHULL',\n 'ST_COVEREDBY',\n 'ST_COVERS',\n 'ST_DIFFERENCE',\n 'ST_DIMENSION',\n 'ST_DISJOINT',\n 'ST_DISTANCE',\n 'ST_DUMP',\n 'ST_DWITHIN',\n 'ST_ENDPOINT',\n 'ST_EQUALS',\n 'ST_EXTENT',\n 'ST_EXTERIORRING',\n 'ST_GEOGFROM',\n 'ST_GEOGFROMGEOJSON',\n 'ST_GEOGFROMTEXT',\n 'ST_GEOGFROMWKB',\n 'ST_GEOGPOINT',\n 'ST_GEOGPOINTFROMGEOHASH',\n 'ST_GEOHASH',\n 'ST_GEOMETRYTYPE',\n 'ST_INTERIORRINGS',\n 'ST_INTERSECTION',\n 'ST_INTERSECTS',\n 'ST_INTERSECTSBOX',\n 'ST_ISCOLLECTION',\n 'ST_ISEMPTY',\n 'ST_LENGTH',\n 'ST_MAKELINE',\n 'ST_MAKEPOLYGON',\n 'ST_MAKEPOLYGONORIENTED',\n 'ST_MAXDISTANCE',\n 'ST_NPOINTS',\n 'ST_NUMGEOMETRIES',\n 'ST_NUMPOINTS',\n 'ST_PERIMETER',\n 'ST_POINTN',\n 'ST_SIMPLIFY',\n 'ST_SNAPTOGRID',\n 'ST_STARTPOINT',\n 'ST_TOUCHES',\n 'ST_UNION',\n 'ST_UNION_AGG',\n 'ST_WITHIN',\n 'ST_X',\n 'ST_Y',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/hash_functions\n hash: ['FARM_FINGERPRINT', 'MD5', 'SHA1', 'SHA256', 'SHA512'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/hll_functions\n hll: ['HLL_COUNT.INIT', 'HLL_COUNT.MERGE', 'HLL_COUNT.MERGE_PARTIAL', 'HLL_COUNT.EXTRACT'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/interval_functions\n interval: ['MAKE_INTERVAL', 'EXTRACT', 'JUSTIFY_DAYS', 'JUSTIFY_HOURS', 'JUSTIFY_INTERVAL'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions\n json: [\n 'JSON_EXTRACT',\n 'JSON_QUERY',\n 'JSON_EXTRACT_SCALAR',\n 'JSON_VALUE',\n 'JSON_EXTRACT_ARRAY',\n 'JSON_QUERY_ARRAY',\n 'JSON_EXTRACT_STRING_ARRAY',\n 'JSON_VALUE_ARRAY',\n 'TO_JSON_STRING',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/mathematical_functions\n math: [\n 'ABS',\n 'SIGN',\n 'IS_INF',\n 'IS_NAN',\n 'IEEE_DIVIDE',\n 'RAND',\n 'SQRT',\n 'POW',\n 'POWER',\n 'EXP',\n 'LN',\n 'LOG',\n 'LOG10',\n 'GREATEST',\n 'LEAST',\n 'DIV',\n 'SAFE_DIVIDE',\n 'SAFE_MULTIPLY',\n 'SAFE_NEGATE',\n 'SAFE_ADD',\n 'SAFE_SUBTRACT',\n 'MOD',\n 'ROUND',\n 'TRUNC',\n 'CEIL',\n 'CEILING',\n 'FLOOR',\n 'COS',\n 'COSH',\n 'ACOS',\n 'ACOSH',\n 'SIN',\n 'SINH',\n 'ASIN',\n 'ASINH',\n 'TAN',\n 'TANH',\n 'ATAN',\n 'ATANH',\n 'ATAN2',\n 'RANGE_BUCKET',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/navigation_functions\n navigation: [\n 'FIRST_VALUE',\n 'LAST_VALUE',\n 'NTH_VALUE',\n 'LEAD',\n 'LAG',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/net_functions\n net: [\n 'NET.IP_FROM_STRING',\n 'NET.SAFE_IP_FROM_STRING',\n 'NET.IP_TO_STRING',\n 'NET.IP_NET_MASK',\n 'NET.IP_TRUNC',\n 'NET.IPV4_FROM_INT64',\n 'NET.IPV4_TO_INT64',\n 'NET.HOST',\n 'NET.PUBLIC_SUFFIX',\n 'NET.REG_DOMAIN',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/numbering_functions\n numbering: ['RANK', 'DENSE_RANK', 'PERCENT_RANK', 'CUME_DIST', 'NTILE', 'ROW_NUMBER'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/security_functions\n security: ['SESSION_USER'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/statistical_aggregate_functions\n statisticalAggregate: [\n 'CORR',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'STDDEV',\n 'VAR_POP',\n 'VAR_SAMP',\n 'VARIANCE',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions\n string: [\n 'ASCII',\n 'BYTE_LENGTH',\n 'CHAR_LENGTH',\n 'CHARACTER_LENGTH',\n 'CHR',\n 'CODE_POINTS_TO_BYTES',\n 'CODE_POINTS_TO_STRING',\n 'CONCAT',\n 'CONTAINS_SUBSTR',\n 'ENDS_WITH',\n 'FORMAT',\n 'FROM_BASE32',\n 'FROM_BASE64',\n 'FROM_HEX',\n 'INITCAP',\n 'INSTR',\n 'LEFT',\n 'LENGTH',\n 'LPAD',\n 'LOWER',\n 'LTRIM',\n 'NORMALIZE',\n 'NORMALIZE_AND_CASEFOLD',\n 'OCTET_LENGTH',\n 'REGEXP_CONTAINS',\n 'REGEXP_EXTRACT',\n 'REGEXP_EXTRACT_ALL',\n 'REGEXP_INSTR',\n 'REGEXP_REPLACE',\n 'REGEXP_SUBSTR',\n 'REPLACE',\n 'REPEAT',\n 'REVERSE',\n 'RIGHT',\n 'RPAD',\n 'RTRIM',\n 'SAFE_CONVERT_BYTES_TO_STRING',\n 'SOUNDEX',\n 'SPLIT',\n 'STARTS_WITH',\n 'STRPOS',\n 'SUBSTR',\n 'SUBSTRING',\n 'TO_BASE32',\n 'TO_BASE64',\n 'TO_CODE_POINTS',\n 'TO_HEX',\n 'TRANSLATE',\n 'TRIM',\n 'UNICODE',\n 'UPPER',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/time_functions\n time: [\n 'CURRENT_TIME',\n 'TIME',\n 'EXTRACT',\n 'TIME_ADD',\n 'TIME_SUB',\n 'TIME_DIFF',\n 'TIME_TRUNC',\n 'FORMAT_TIME',\n 'PARSE_TIME',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions\n timestamp: [\n 'CURRENT_TIMESTAMP',\n 'EXTRACT',\n 'STRING',\n 'TIMESTAMP',\n 'TIMESTAMP_ADD',\n 'TIMESTAMP_SUB',\n 'TIMESTAMP_DIFF',\n 'TIMESTAMP_TRUNC',\n 'FORMAT_TIMESTAMP',\n 'PARSE_TIMESTAMP',\n 'TIMESTAMP_SECONDS',\n 'TIMESTAMP_MILLIS',\n 'TIMESTAMP_MICROS',\n 'UNIX_SECONDS',\n 'UNIX_MILLIS',\n 'UNIX_MICROS',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/uuid_functions\n uuid: ['GENERATE_UUID'],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/conditional_expressions\n conditional: ['COALESCE', 'IF', 'IFNULL', 'NULLIF'],\n // https://cloud.google.com/bigquery/docs/reference/legacy-sql\n legacyAggregate: [\n 'AVG',\n 'BIT_AND',\n 'BIT_OR',\n 'BIT_XOR',\n 'CORR',\n 'COUNT',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'EXACT_COUNT_DISTINCT',\n 'FIRST',\n 'GROUP_CONCAT',\n 'GROUP_CONCAT_UNQUOTED',\n 'LAST',\n 'MAX',\n 'MIN',\n 'NEST',\n 'NTH',\n 'QUANTILES',\n 'STDDEV',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'SUM',\n 'TOP',\n 'UNIQUE',\n 'VARIANCE',\n 'VAR_POP',\n 'VAR_SAMP',\n ],\n legacyBitwise: ['BIT_COUNT'],\n legacyCasting: ['BOOLEAN', 'BYTES', 'CAST', 'FLOAT', 'HEX_STRING', 'INTEGER', 'STRING'],\n legacyComparison: [\n // expr 'IN',\n 'COALESCE',\n 'GREATEST',\n 'IFNULL',\n 'IS_INF',\n 'IS_NAN',\n 'IS_EXPLICITLY_DEFINED',\n 'LEAST',\n 'NVL',\n ],\n legacyDatetime: [\n 'CURRENT_DATE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'DATE',\n 'DATE_ADD',\n 'DATEDIFF',\n 'DAY',\n 'DAYOFWEEK',\n 'DAYOFYEAR',\n 'FORMAT_UTC_USEC',\n 'HOUR',\n 'MINUTE',\n 'MONTH',\n 'MSEC_TO_TIMESTAMP',\n 'NOW',\n 'PARSE_UTC_USEC',\n 'QUARTER',\n 'SEC_TO_TIMESTAMP',\n 'SECOND',\n 'STRFTIME_UTC_USEC',\n 'TIME',\n 'TIMESTAMP',\n 'TIMESTAMP_TO_MSEC',\n 'TIMESTAMP_TO_SEC',\n 'TIMESTAMP_TO_USEC',\n 'USEC_TO_TIMESTAMP',\n 'UTC_USEC_TO_DAY',\n 'UTC_USEC_TO_HOUR',\n 'UTC_USEC_TO_MONTH',\n 'UTC_USEC_TO_WEEK',\n 'UTC_USEC_TO_YEAR',\n 'WEEK',\n 'YEAR',\n ],\n legacyIp: ['FORMAT_IP', 'PARSE_IP', 'FORMAT_PACKED_IP', 'PARSE_PACKED_IP'],\n legacyJson: ['JSON_EXTRACT', 'JSON_EXTRACT_SCALAR'],\n legacyMath: [\n 'ABS',\n 'ACOS',\n 'ACOSH',\n 'ASIN',\n 'ASINH',\n 'ATAN',\n 'ATANH',\n 'ATAN2',\n 'CEIL',\n 'COS',\n 'COSH',\n 'DEGREES',\n 'EXP',\n 'FLOOR',\n 'LN',\n 'LOG',\n 'LOG2',\n 'LOG10',\n 'PI',\n 'POW',\n 'RADIANS',\n 'RAND',\n 'ROUND',\n 'SIN',\n 'SINH',\n 'SQRT',\n 'TAN',\n 'TANH',\n ],\n legacyRegex: ['REGEXP_MATCH', 'REGEXP_EXTRACT', 'REGEXP_REPLACE'],\n legacyString: [\n 'CONCAT',\n // expr CONTAINS 'str'\n 'INSTR',\n 'LEFT',\n 'LENGTH',\n 'LOWER',\n 'LPAD',\n 'LTRIM',\n 'REPLACE',\n 'RIGHT',\n 'RPAD',\n 'RTRIM',\n 'SPLIT',\n 'SUBSTR',\n 'UPPER',\n ],\n legacyTableWildcard: ['TABLE_DATE_RANGE', 'TABLE_DATE_RANGE_STRICT', 'TABLE_QUERY'],\n legacyUrl: ['HOST', 'DOMAIN', 'TLD'],\n legacyWindow: [\n 'AVG',\n 'COUNT',\n 'MAX',\n 'MIN',\n 'STDDEV',\n 'SUM',\n 'CUME_DIST',\n 'DENSE_RANK',\n 'FIRST_VALUE',\n 'LAG',\n 'LAST_VALUE',\n 'LEAD',\n 'NTH_VALUE',\n 'NTILE',\n 'PERCENT_RANK',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'RANK',\n 'RATIO_TO_REPORT',\n 'ROW_NUMBER',\n ],\n legacyMisc: [\n 'CURRENT_USER',\n 'EVERY',\n 'FROM_BASE64',\n 'HASH',\n 'FARM_FINGERPRINT',\n 'IF',\n 'POSITION',\n 'SHA1',\n 'SOME',\n 'TO_BASE64',\n ],\n other: ['BQ.JOBS.CANCEL', 'BQ.REFRESH_MATERIALIZED_VIEW'],\n};\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\nconst reservedKeywords = {\n keywords: [\n 'ALL',\n // 'AND',\n 'ANY',\n // 'ARRAY',\n 'AS',\n 'ASC',\n 'ASSERT_ROWS_MODIFIED',\n 'AT',\n 'BETWEEN',\n 'BY',\n // 'CASE',\n 'CAST',\n 'COLLATE',\n 'CONTAINS',\n // 'CREATE',\n // 'CROSS',\n 'CUBE',\n 'CURRENT',\n 'DEFAULT',\n 'DEFINE',\n 'DESC',\n 'DISTINCT',\n // 'ELSE',\n // 'END',\n 'ENUM',\n 'ESCAPE',\n // 'EXCEPT',\n // 'EXCLUDE',\n 'EXISTS',\n 'EXTRACT',\n 'FALSE',\n // 'FETCH',\n 'FOLLOWING',\n 'FOR',\n // 'FROM',\n 'FULL',\n // 'GROUP',\n 'GROUPING',\n 'GROUPS',\n 'HASH',\n // 'HAVING',\n 'IF',\n 'IGNORE',\n 'IN',\n // 'INNER',\n // 'INTERSECT',\n // 'INTERVAL',\n 'INTO',\n 'IS',\n // 'JOIN',\n // 'LATERAL',\n // 'LEFT',\n 'LIKE',\n // 'LIMIT',\n 'LOOKUP',\n // 'MERGE',\n // 'NATURAL',\n 'NEW',\n 'NO',\n 'NOT',\n 'NULL',\n 'NULLS',\n 'OF',\n // 'ON',\n // 'OR',\n // 'ORDER',\n // 'OUTER',\n 'OVER',\n 'PARTITION',\n 'PRECEDING',\n 'PROTO',\n 'RANGE',\n 'RECURSIVE',\n 'RESPECT',\n // 'RIGHT',\n 'ROLLUP',\n 'ROWS',\n // 'SELECT',\n // 'SET',\n 'SOME',\n // 'STRUCT',\n 'TABLE',\n // 'TABLESAMPLE',\n 'THEN',\n 'TO',\n 'TREAT',\n 'TRUE',\n 'UNBOUNDED',\n // 'UNION',\n // 'UNNEST',\n // 'USING',\n // 'WHEN',\n // 'WHERE',\n // 'WINDOW',\n // 'WITH',\n 'WITHIN',\n ],\n datatypes: [\n 'ARRAY', // parametric, ARRAY<T>\n 'BOOL',\n 'BYTES', // parameterised, BYTES(Length)\n 'DATE',\n 'DATETIME',\n 'GEOGRAPHY',\n 'INTERVAL',\n 'INT64',\n 'INT',\n 'SMALLINT',\n 'INTEGER',\n 'BIGINT',\n 'TINYINT',\n 'BYTEINT',\n 'NUMERIC', // parameterised, NUMERIC(Precision[, Scale])\n 'DECIMAL', // parameterised, DECIMAL(Precision[, Scale])\n 'BIGNUMERIC', // parameterised, BIGNUMERIC(Precision[, Scale])\n 'BIGDECIMAL', // parameterised, BIGDECIMAL(Precision[, Scale])\n 'FLOAT64',\n 'STRING', // parameterised, STRING(Length)\n 'STRUCT', // parametric, STRUCT<T>\n 'TIME',\n 'TIMEZONE',\n ],\n // https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions#formatting_syntax\n stringFormat: ['HEX', 'BASEX', 'BASE64M', 'ASCII', 'UTF-8', 'UTF8'],\n misc: ['SAFE'],\n};\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\nconst reservedCommands = [\n // DQL, https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax\n 'SELECT',\n 'FROM',\n 'UNNEST',\n 'PIVOT',\n 'UNPIVOT',\n 'TABLESAMPLE SYSTEM',\n 'WHERE',\n 'GROUP BY',\n 'HAVING',\n 'ORDER BY',\n 'QUALIFY',\n 'WINDOW',\n 'LIMIT',\n 'OFFSET',\n 'WITH',\n 'OMIT RECORD IF', // legacy\n // DML, https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax\n 'INSERT',\n 'INSERT INTO',\n 'VALUES',\n 'DELETE',\n // 'DELETE FROM',\n 'TRUNCATE TABLE',\n 'UPDATE',\n 'MERGE',\n 'MERGE INTO',\n // 'USING',\n // DDL, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language\n 'SET SCHEMA', // added\n 'CREATE SCHEMA',\n 'CREATE TABLE',\n 'CREATE TABLE LIKE',\n 'CREATE TABLE COPY',\n 'CREATE SNAPSHOT TABLE',\n 'CREATE TABLE CLONE',\n 'CREATE VIEW',\n 'CREATE MATERIALIZED VIEW',\n 'CREATE EXTERNAL TABLE',\n 'CREATE FUNCTION',\n 'CREATE TABLE FUNCTION',\n 'CREATE PROCEDURE',\n 'CREATE ROW ACCESS POLICY',\n 'ALTER SCHEMA SET OPTIONS',\n 'ALTER TABLE SET OPTIONS',\n 'ALTER TABLE ADD COLUMN',\n 'ALTER TABLE RENAME TO',\n 'ALTER TABLE DROP COLUMN',\n 'ALTER COLUMN SET OPTIONS',\n 'ALTER COLUMN DROP NOT NULL',\n 'ALTER COLUMN SET DATA TYPE',\n 'ALTER VIEW SET OPTIONS',\n 'ALTER MATERIALIZED VIEW SET OPTIONS',\n 'DROP SCHEMA',\n 'DROP TABLE',\n 'DROP SNAPSHOT TABLE',\n 'DROP EXTERNAL TABLE',\n 'DROP VIEW',\n 'DROP MATERIALIZED VIEW',\n 'DROP FUNCTION',\n 'DROP TABLE FUNCTION',\n 'DROP PROCEDURE',\n 'DROP ROW ACCESS POLICY',\n // DCL, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-control-language\n 'GRANT',\n 'REVOKE',\n 'CREATE CAPACITY',\n 'CREATE RESERVATION',\n 'CREATE ASSIGNMENT',\n 'DROP CAPACITY',\n 'DROP RESERVATION',\n 'DROP ASSIGNMENT',\n // Script, https://cloud.google.com/bigquery/docs/reference/standard-sql/scripting\n 'DECLARE',\n 'SET',\n 'EXECUTE IMMEDIATE',\n 'LOOP',\n 'END LOOP',\n 'REPEAT',\n 'END REPEAT',\n 'WHILE',\n 'END WHILE',\n 'BREAK',\n 'LEAVE',\n 'CONTINUE',\n 'ITERATE',\n 'FOR',\n 'END FOR',\n 'BEGIN',\n 'BEGIN TRANSACTION',\n 'COMMIT TRANSACTION',\n 'ROLLBACK TRANSACTION',\n 'RAISE',\n 'RETURN',\n 'CALL',\n // Debug, https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging-statements\n 'ASSERT',\n // Other, https://cloud.google.com/bigquery/docs/reference/standard-sql/other-statements\n 'EXPORT DATA',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\n// https://cloud.google.com/bigquery/docs/reference/#standard-sql-reference\nexport default class BigQueryFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR'];\n static fullReservedWords = dedupe([\n ...Object.values(reservedFunctions).reduce((acc, arr) => [...acc, ...arr], []),\n ...Object.values(reservedKeywords).reduce((acc, arr) => [...acc, ...arr], []),\n ]);\n\n static stringTypes: StringPatternType[] = ['\"\"', \"''\", '``']; // add: '''''', \"\"\"\"\"\" ; prefixes: r, b\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = [];\n static lineCommentTypes = ['--', '#'];\n static specialWordChars = { any: '_@$-' };\n static operators = ['>>', '<<', '||'];\n // TODO: handle trailing comma in select clause\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: BigQueryFormatter.reservedCommands,\n reservedBinaryCommands: BigQueryFormatter.reservedBinaryCommands,\n reservedDependentClauses: BigQueryFormatter.reservedDependentClauses,\n reservedJoinConditions: BigQueryFormatter.reservedJoinConditions,\n reservedLogicalOperators: BigQueryFormatter.reservedLogicalOperators,\n reservedKeywords: BigQueryFormatter.fullReservedWords,\n stringTypes: BigQueryFormatter.stringTypes,\n blockStart: BigQueryFormatter.blockStart,\n blockEnd: BigQueryFormatter.blockEnd,\n indexedPlaceholderTypes: BigQueryFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: BigQueryFormatter.namedPlaceholderTypes,\n lineCommentTypes: BigQueryFormatter.lineCommentTypes,\n specialWordChars: BigQueryFormatter.specialWordChars,\n operators: BigQueryFormatter.operators,\n });\n }\n\n tokenOverride(token: Token) {\n if (\n (/ARRAY/i.test(token.value) || /STRUCT/i.test(token.value)) &&\n this.tokenLookAhead().value === '<'\n ) {\n let level = 0;\n let finalToken = token.value;\n\n do {\n const nextToken = this.tokenLookAhead();\n if (nextToken.value === '>' || nextToken.value === '>>') {\n level -= nextToken.value.length;\n } else if (nextToken.value === '<') {\n level++;\n }\n finalToken += this.tokens.splice(this.index + 1, 1)[0].value;\n } while (level > 0);\n\n return { ...token, value: finalToken };\n }\n\n return token;\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\nconst reservedFunctions = {\n // https://www.ibm.com/docs/en/db2-for-zos/11?topic=functions-aggregate\n aggregate: [\n 'ARRAY_AGG',\n 'AVG',\n 'CORR',\n 'CORRELATION',\n 'COUNT',\n 'COUNT_BIG',\n 'COVAR_POP',\n 'COVARIANCE',\n 'COVAR',\n 'COVAR_SAMP',\n 'COVARIANCE_SAMP',\n 'CUME_DIST',\n 'GROUPING',\n 'LISTAGG',\n 'MAX',\n 'MEDIAN',\n 'MIN',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'PERCENT_RANK',\n 'REGR_AVGX',\n 'REGR_AVGY',\n 'REGR_COUNT',\n 'REGR_INTERCEPT',\n 'REGR_ICPT',\n 'REGR_R2',\n 'REGR_SLOPE',\n 'REGR_SXX',\n 'REGR_SXY',\n 'REGR_SYY',\n 'STDDEV_POP',\n 'STDDEV',\n 'STDDEV_SAMP',\n 'SUM',\n 'VAR_POP',\n 'VARIANCE',\n 'VAR',\n 'VAR_SAMP',\n 'VARIANCE_SAMP',\n 'XMLAGG',\n ],\n // https://www.ibm.com/docs/en/db2-for-zos/11?topic=functions-scalar\n scalar: [\n 'ABS',\n 'ABSVAL',\n 'ACOS',\n 'ADD_DAYS',\n 'ADD_MONTHS',\n 'ARRAY_DELETE',\n 'ARRAY_FIRST',\n 'ARRAY_LAST',\n 'ARRAY_NEXT',\n 'ARRAY_PRIOR',\n 'ARRAY_TRIM',\n 'ASCII',\n 'ASCII_CHR',\n 'ASCII_STR',\n 'ASCIISTR',\n 'ASIN',\n 'ATAN',\n 'ATANH',\n 'ATAN2',\n 'BIGINT',\n 'BINARY',\n 'BITAND',\n 'BITANDNOT',\n 'BITOR',\n 'BITXOR',\n 'BITNOT',\n 'BLOB',\n 'BTRIM',\n 'CARDINALITY',\n 'CCSID_ENCODING',\n 'CEILING',\n 'CEIL',\n 'CHAR',\n 'CHAR9',\n 'CHARACTER_LENGTH',\n 'CHAR_LENGTH',\n 'CHR',\n 'CLOB',\n 'COALESCE',\n 'COLLATION_KEY',\n 'COMPARE_DECFLOAT',\n 'CONCAT',\n 'CONTAINS',\n 'COS',\n 'COSH',\n 'DATE',\n 'DAY',\n 'DAYOFMONTH',\n 'DAYOFWEEK',\n 'DAYOFWEEK_ISO',\n 'DAYOFYEAR',\n 'DAYS',\n 'DAYS_BETWEEN',\n 'DBCLOB',\n 'DECFLOAT',\n 'DECFLOAT_FORMAT',\n 'DECFLOAT_SORTKEY',\n 'DECIMAL',\n 'DEC',\n 'DECODE',\n 'DECRYPT_BINARY',\n 'DECRYPT_BIT',\n 'DECRYPT_CHAR',\n 'DECRYPT_DB',\n 'DECRYPT_DATAKEY_BIGINT',\n 'DECRYPT_DATAKEY_BIT',\n 'DECRYPT_DATAKEY_CLOB',\n 'DECRYPT_DATAKEY_DBCLOB',\n 'DECRYPT_DATAKEY_DECIMAL',\n 'DECRYPT_DATAKEY_INTEGER',\n 'DECRYPT_DATAKEY_VARCHAR',\n 'DECRYPT_DATAKEY_VARGRAPHIC',\n 'DEGREES',\n 'DIFFERENCE',\n 'DIGITS',\n 'DOUBLE_PRECISION',\n 'DOUBLE',\n 'DSN_XMLVALIDATE',\n 'EBCDIC_CHR',\n 'EBCDIC_STR',\n 'ENCRYPT_DATAKEY',\n 'ENCRYPT_TDES',\n 'EXP',\n 'EXTRACT',\n 'FLOAT',\n 'FLOOR',\n 'GENERATE_UNIQUE',\n 'GENERATE_UNIQUE_BINARY',\n 'GETHINT',\n 'GETVARIABLE',\n 'GRAPHIC',\n 'GREATEST',\n 'HASH',\n 'HASH_CRC32',\n 'HASH_MD5',\n 'HASH_SHA1',\n 'HASH_SHA256',\n 'HEX',\n 'HOUR',\n 'IDENTITY_VAL_LOCAL',\n 'IFNULL',\n 'INSERT',\n 'INSTR',\n 'INTEGER',\n 'INT',\n 'JULIAN_DAY',\n 'LAST_DAY',\n 'LCASE',\n 'LEAST',\n 'LEFT',\n 'LENGTH',\n 'LN',\n 'LOCATE',\n 'LOCATE_IN_STRING',\n 'LOG10',\n 'LOWER',\n 'LPAD',\n 'LTRIM',\n 'MAX',\n 'MAX_CARDINALITY',\n 'MICROSECOND',\n 'MIDNIGHT_SECONDS',\n 'MIN',\n 'MINUTE',\n 'MOD',\n 'MONTH',\n 'MONTHS_BETWEEN',\n 'MQREAD',\n 'MQREADCLOB',\n 'MQRECEIVE',\n 'MQRECEIVECLOB',\n 'MQSEND',\n 'MULTIPLY_ALT',\n 'NEXT_DAY',\n 'NEXT_MONTH',\n 'NORMALIZE_DECFLOAT',\n 'NORMALIZE_STRING',\n 'NULLIF',\n 'NVL',\n 'OVERLAY',\n 'PACK',\n 'POSITION',\n 'POSSTR',\n 'POWER',\n 'POW',\n 'QUANTIZE',\n 'QUARTER',\n 'RADIANS',\n 'RAISE_ERROR',\n 'RANDOM',\n 'RAND',\n 'REAL',\n 'REGEXP_COUNT',\n 'REGEXP_INSTR',\n 'REGEXP_LIKE',\n 'REGEXP_REPLACE',\n 'REGEXP_SUBSTR',\n 'REPEAT',\n 'REPLACE',\n 'RID',\n 'RIGHT',\n 'ROUND',\n 'ROUND_TIMESTAMP',\n 'ROWID',\n 'RPAD',\n 'RTRIM',\n 'SCORE',\n 'SECOND',\n 'SIGN',\n 'SIN',\n 'SINH',\n 'SMALLINT',\n 'SOUNDEX',\n 'SOAPHTTPC',\n 'SOAPHTTPV',\n 'SOAPHTTPNC',\n 'SOAPHTTPNV',\n 'SPACE',\n 'SQRT',\n 'STRIP',\n 'STRLEFT',\n 'STRPOS',\n 'STRRIGHT',\n 'SUBSTR',\n 'SUBSTRING',\n 'TAN',\n 'TANH',\n 'TIME',\n 'TIMESTAMP',\n 'TIMESTAMPADD',\n 'TIMESTAMPDIFF',\n 'TIMESTAMP_FORMAT',\n 'TIMESTAMP_ISO',\n 'TIMESTAMP_TZ',\n 'TO_CHAR',\n 'TO_CLOB',\n 'TO_DATE',\n 'TO_NUMBER',\n 'TOTALORDER',\n 'TO_TIMESTAMP',\n 'TRANSLATE',\n 'TRIM',\n 'TRIM_ARRAY',\n 'TRUNCATE',\n 'TRUNC',\n 'TRUNC_TIMESTAMP',\n 'UCASE',\n 'UNICODE',\n 'UNICODE_STR',\n 'UNISTR',\n 'UPPER',\n 'VALUE',\n 'VARBINARY',\n 'VARCHAR',\n 'VARCHAR9',\n 'VARCHAR_BIT_FORMAT',\n 'VARCHAR_FORMAT',\n 'VARGRAPHIC',\n 'VERIFY_GROUP_FOR_USER',\n 'VERIFY_ROLE_FOR_USER',\n 'VERIFY_TRUSTED_CONTEXT_ROLE_FOR_USER',\n 'WEEK',\n 'WEEK_ISO',\n 'WRAP',\n 'XMLATTRIBUTES',\n 'XMLCOMMENT',\n 'XMLCONCAT',\n 'XMLDOCUMENT',\n 'XMLELEMENT',\n 'XMLFOREST',\n 'XMLMODIFY',\n 'XMLNAMESPACES',\n 'XMLPARSE',\n 'XMLPI',\n 'XMLQUERY',\n 'XMLSERIALIZE',\n 'XMLTEXT',\n 'XMLXSROBJECTID',\n 'XSLTRANSFORM',\n 'YEAR',\n ],\n // https://www.ibm.com/docs/en/db2-for-zos/11?topic=functions-table\n table: [\n 'ADMIN_TASK_LIST',\n 'ADMIN_TASK_OUTPUT',\n 'ADMIN_TASK_STATUS',\n 'BLOCKING_THREADS',\n 'MQREADALL',\n 'MQREADALLCLOB',\n 'MQRECEIVEALL',\n 'MQRECEIVEALLCLOB',\n 'XMLTABLE',\n ],\n // https://www.ibm.com/docs/en/db2-for-zos/11?topic=functions-row\n row: ['UNPACK'],\n // https://www.ibm.com/docs/en/db2-for-zos/12?topic=expressions-olap-specification\n olap: ['FIRST_VALUE', 'LAG', 'LAST_VALUE', 'LEAD', 'NTH_VALUE', 'NTILE', 'RATIO_TO_REPORT'],\n};\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\nconst reservedKeywords = {\n // https://www.ibm.com/docs/en/db2-for-zos/11?topic=words-reserved#db2z_reservedwords__newresword\n standard: [\n 'ALL',\n 'ALLOCATE',\n 'ALLOW',\n 'ALTERAND',\n 'ANY',\n 'AS',\n 'ARRAY',\n 'ARRAY_EXISTS',\n 'ASENSITIVE',\n 'ASSOCIATE',\n 'ASUTIME',\n 'AT',\n 'AUDIT',\n 'AUX',\n 'AUXILIARY',\n 'BEFORE',\n 'BEGIN',\n 'BETWEEN',\n 'BUFFERPOOL',\n 'BY',\n 'CAPTURE',\n 'CASCADED',\n 'CASE',\n 'CAST',\n 'CCSID',\n 'CHARACTER',\n 'CHECK',\n 'CLONE',\n 'CLUSTER',\n 'COLLECTION',\n 'COLLID',\n 'COLUMN',\n 'CONDITION',\n 'CONNECTION',\n 'CONSTRAINT',\n 'CONTENT',\n 'CONTINUE',\n 'CREATE',\n 'CUBE',\n 'CURRENT',\n 'CURRENT_DATE',\n 'CURRENT_LC_CTYPE',\n 'CURRENT_PATH',\n 'CURRENT_SCHEMA',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'CURRVAL',\n 'CURSOR',\n 'DATA',\n 'DATABASE',\n 'DBINFO',\n 'DECLARE',\n 'DEFAULT',\n 'DESCRIPTOR',\n 'DETERMINISTIC',\n 'DISABLE',\n 'DISALLOW',\n 'DISTINCT',\n 'DO',\n 'DOCUMENT',\n 'DSSIZE',\n 'DYNAMIC',\n 'EDITPROC',\n 'ENCODING',\n 'ENCRYPTION',\n 'ENDING',\n 'END-EXEC',\n 'ERASE',\n 'ESCAPE',\n 'EXCEPTION',\n 'EXISTS',\n 'EXIT',\n 'EXTERNAL',\n 'FENCED',\n 'FIELDPROC',\n 'FINAL',\n 'FIRST',\n 'FOR',\n 'FREE',\n 'FULL',\n 'FUNCTION',\n 'GENERATED',\n 'GET',\n 'GLOBAL',\n 'GOTO',\n 'GROUP',\n 'HANDLER',\n 'HOLD',\n 'HOURS',\n 'IF',\n 'IMMEDIATE',\n 'IN',\n 'INCLUSIVE',\n 'INDEX',\n 'INHERIT',\n 'INNER',\n 'INOUT',\n 'INSENSITIVE',\n 'INTO',\n 'IS',\n 'ISOBID',\n 'ITERATE',\n 'JAR',\n 'KEEP',\n 'KEY',\n 'LANGUAGE',\n 'LAST',\n 'LC_CTYPE',\n 'LEAVE',\n 'LIKE',\n 'LOCAL',\n 'LOCALE',\n 'LOCATOR',\n 'LOCATORS',\n 'LOCK',\n 'LOCKMAX',\n 'LOCKSIZE',\n 'LONG',\n 'LOOP',\n 'MAINTAINED',\n 'MATERIALIZED',\n 'MICROSECONDS',\n 'MINUTEMINUTES',\n 'MODIFIES',\n 'MONTHS',\n 'NEXT',\n 'NEXTVAL',\n 'NO',\n 'NONE',\n 'NOT',\n 'NULL',\n 'NULLS',\n 'NUMPARTS',\n 'OBID',\n 'OF',\n 'OLD',\n 'ON DELETE',\n 'ON UPDATE',\n 'OPTIMIZATION',\n 'OPTIMIZE',\n 'ORDER',\n 'ORGANIZATION',\n 'OUT',\n 'OUTER',\n 'PACKAGE',\n 'PARAMETER',\n 'PART',\n 'PADDED',\n 'PARTITION',\n 'PARTITIONED',\n 'PARTITIONING',\n 'PATH',\n 'PIECESIZE',\n 'PERIOD',\n 'PLAN',\n 'PRECISION',\n 'PREVVAL',\n 'PRIOR',\n 'PRIQTY',\n 'PRIVILEGES',\n 'PROCEDURE',\n 'PROGRAM',\n 'PSID',\n 'PUBLIC',\n 'QUERY',\n 'QUERYNO',\n 'READS',\n 'REFERENCES',\n 'RESIGNAL',\n 'RESTRICT',\n 'RESULT',\n 'RESULT_SET_LOCATOR',\n 'RETURN',\n 'RETURNS',\n 'ROLE',\n 'ROLLUP',\n 'ROUND_CEILING',\n 'ROUND_DOWN',\n 'ROUND_FLOOR',\n 'ROUND_HALF_DOWN',\n 'ROUND_HALF_EVEN',\n 'ROUND_HALF_UP',\n 'ROUND_UP',\n 'ROW',\n 'ROWSET',\n 'SCHEMA',\n 'SCRATCHPAD',\n 'SECONDS',\n 'SECQTY',\n 'SECURITY',\n 'SEQUENCE',\n 'SENSITIVE',\n 'SESSION_USER',\n 'SIMPLE',\n 'SOME',\n 'SOURCE',\n 'SPECIFIC',\n 'STANDARD',\n 'STATIC',\n 'STATEMENT',\n 'STAY',\n 'STOGROUP',\n 'STORES',\n 'STYLE',\n 'SUMMARY',\n 'SYNONYM',\n 'SYSDATE',\n 'SYSTEM',\n 'SYSTIMESTAMP',\n 'TABLE',\n 'TABLESPACE',\n 'THEN',\n 'TO',\n 'TRIGGER',\n 'TYPE',\n 'UNDO',\n 'UNIQUE',\n 'UNTIL',\n 'USER',\n 'VALIDPROC',\n 'VARIABLE',\n 'VARIANT',\n 'VCAT',\n 'VERSIONING',\n 'VIEW',\n 'VOLATILE',\n 'VOLUMES',\n 'WHILE',\n 'WLM',\n 'XMLEXISTS',\n 'XMLCAST',\n 'YEARS',\n 'ZONE',\n ],\n // https://www.ibm.com/docs/en/db2-for-zos/11?topic=utilities-db2-online\n onlineUtilies: [\n 'BACKUP SYSTEM',\n 'CATENFM',\n 'CATMAINT',\n 'CHECK DATA',\n 'CHECK INDEX',\n 'CHECK LOB',\n 'COPY',\n 'COPYTOCOPY',\n 'DIAGNOSE',\n 'EXEC SQL',\n 'LISTDEF',\n 'LOAD',\n 'MERGECOPY',\n 'MODIFY RECOVERY',\n 'MODIFY STATISTICS',\n 'OPTIONS',\n 'QUIESCE',\n 'REBUILD INDEX',\n 'RECOVER',\n 'REORG INDEX',\n 'REORG TABLESPACE',\n 'REPAIR',\n 'REPORT',\n 'RESTORE SYSTEM',\n 'RUNSTATS',\n 'STOSPACE',\n 'TEMPLATE',\n 'UNLOAD',\n ],\n // https://www.ibm.com/docs/en/db2-for-zos/11?topic=db2-commands\n commands: [\n 'ABEND',\n 'ACCESS DATABASE',\n 'ALTER BUFFERPOOL',\n 'ALTER GROUPBUFFERPOOL',\n 'ALTER UTILITY',\n 'ARCHIVE LOG',\n 'BIND PACKAGE',\n 'BIND PLAN',\n 'BIND QUERY',\n 'BIND SERVICE',\n 'BIND',\n 'REBIND',\n 'CANCEL THREAD',\n 'DCLGEN',\n 'DISPLAY ACCEL',\n 'DISPLAY ARCHIVE',\n 'DISPLAY BLOCKERS',\n 'DISPLAY BUFFERPOOL',\n 'DISPLAY DATABASE',\n 'DISPLAY DDF',\n 'DISPLAY FUNCTION SPECIFIC',\n 'DISPLAY GROUP',\n 'DISPLAY GROUPBUFFERPOOL',\n 'DISPLAY LOCATION',\n 'DISPLAY LOG',\n 'DISPLAY PROCEDURE',\n 'DISPLAY PROFILE',\n 'DISPLAY RLIMIT',\n 'DISPLAY RESTSVC',\n 'DISPLAY THREAD',\n 'DISPLAY TRACE',\n 'DISPLAY UTILITY',\n 'DSN',\n 'DSNH',\n 'END',\n 'FREE PACKAGE',\n 'FREE PLAN',\n 'FREE QUERY',\n 'FREE SERVICE',\n 'MODIFY admtproc,APPL=SHUTDOWN',\n 'MODIFY admtproc,APPL=TRACE',\n 'MODIFY DDF',\n 'MODIFY irlmproc,ABEND',\n 'MODIFY irlmproc,DIAG',\n 'MODIFY irlmproc,PURGE',\n 'MODIFY irlmproc,SET',\n 'MODIFY irlmproc,STATUS',\n 'MODIFY TRACE',\n 'REBIND PACKAGE',\n 'REBIND PLAN',\n 'REBIND TRIGGER PACKAGE',\n 'RECOVER BSDS',\n 'RECOVER INDOUBT',\n 'RECOVER POSTPONED',\n 'REFRESH DB2,EARLY',\n 'RESET GENERICLU',\n 'RESET INDOUBT',\n 'RUN',\n 'SET ARCHIVE',\n 'SET LOG',\n 'SET SYSPARM',\n 'SPUFI',\n 'START ACCEL',\n 'START admtproc',\n 'START CDDS',\n 'START DATABASE',\n 'START DB2',\n 'START DDF',\n 'START FUNCTION SPECIFIC',\n 'START irlmproc',\n 'START PROCEDURE',\n 'START PROFILE',\n 'START RLIMIT',\n 'START RESTSVC',\n 'START TRACE',\n 'STOP ACCEL',\n 'STOP admtproc',\n 'STOP CDDS',\n 'STOP DATABASE',\n 'STOP DB2',\n 'STOP DDF',\n 'STOP FUNCTION SPECIFIC',\n 'STOP irlmproc',\n 'STOP PROCEDURE',\n 'STOP PROFILE',\n 'STOP RLIMIT',\n 'STOP RESTSVC',\n 'STOP TRACE',\n 'TERM UTILITY',\n 'TRACE CT',\n ],\n};\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// https://www.ibm.com/docs/en/db2-for-zos/11?topic=statements-list-supported\nconst reservedCommands = [\n 'ALLOCATE CURSOR',\n 'ALTER DATABASE',\n 'ALTER FUNCTION',\n 'ALTER INDEX',\n 'ALTER MASK',\n 'ALTER PERMISSION',\n 'ALTER PROCEDURE',\n 'ALTER SEQUENCE',\n 'ALTER STOGROUP',\n 'ALTER TABLE',\n 'ALTER TABLESPACE',\n 'ALTER TRIGGER',\n 'ALTER TRUSTED CONTEXT',\n 'ALTER VIEW',\n 'ASSOCIATE LOCATORS',\n 'BEGIN DECLARE SECTION',\n 'CALL',\n 'CLOSE',\n 'COMMENT',\n 'COMMIT',\n 'CONNECT',\n 'CREATE ALIAS',\n 'CREATE AUXILIARY TABLE',\n 'CREATE DATABASE',\n 'CREATE FUNCTION',\n 'CREATE GLOBAL TEMPORARY TABLE',\n 'CREATE INDEX',\n 'CREATE LOB TABLESPACE',\n 'CREATE MASK',\n 'CREATE PERMISSION',\n 'CREATE PROCEDURE',\n 'CREATE ROLE',\n 'CREATE SEQUENCE',\n 'CREATE STOGROUP',\n 'CREATE SYNONYM',\n 'CREATE TABLE',\n 'CREATE TABLESPACE',\n 'CREATE TRIGGER',\n 'CREATE TRUSTED CONTEXT',\n 'CREATE TYPE',\n 'CREATE VARIABLE',\n 'CREATE VIEW',\n 'DECLARE CURSOR',\n 'DECLARE GLOBAL TEMPORARY TABLE',\n 'DECLARE STATEMENT',\n 'DECLARE TABLE',\n 'DECLARE VARIABLE',\n 'DELETE',\n 'DESCRIBE CURSOR',\n 'DESCRIBE INPUT',\n 'DESCRIBE OUTPUT',\n 'DESCRIBE PROCEDURE',\n 'DESCRIBE TABLE',\n 'DROP',\n 'END DECLARE SECTION',\n 'EXCHANGE',\n 'EXECUTE',\n 'EXECUTE IMMEDIATE',\n 'EXPLAIN',\n 'FETCH',\n 'FREE LOCATOR',\n 'GET DIAGNOSTICS',\n 'GRANT',\n 'HOLD LOCATOR',\n 'INCLUDE',\n 'INSERT',\n 'LABEL',\n 'LOCK TABLE',\n 'MERGE',\n 'OPEN',\n 'PREPARE',\n 'REFRESH',\n 'RELEASE',\n 'RELEASE SAVEPOINT',\n 'RENAME',\n 'REVOKE',\n 'ROLLBACK',\n 'SAVEPOINT',\n 'SELECT',\n 'SELECT INTO',\n 'SET CONNECTION',\n 'SET',\n 'SET CURRENT ACCELERATOR',\n 'SET CURRENT APPLICATION COMPATIBILITY',\n 'SET CURRENT APPLICATION ENCODING SCHEME',\n 'SET CURRENT DEBUG MODE',\n 'SET CURRENT DECFLOAT ROUNDING MODE',\n 'SET CURRENT DEGREE',\n 'SET CURRENT EXPLAIN MODE',\n 'SET CURRENT GET_ACCEL_ARCHIVE',\n 'SET CURRENT LOCALE LC_CTYPE',\n 'SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION',\n 'SET CURRENT OPTIMIZATION HINT',\n 'SET CURRENT PACKAGE PATH',\n 'SET CURRENT PACKAGESET',\n 'SET CURRENT PRECISION',\n 'SET CURRENT QUERY ACCELERATION',\n 'SET CURRENT QUERY ACCELERATION WAITFORDATA',\n 'SET CURRENT REFRESH AGE',\n 'SET CURRENT ROUTINE VERSION',\n 'SET CURRENT RULES',\n 'SET CURRENT SQLID',\n 'SET CURRENT TEMPORAL BUSINESS_TIME',\n 'SET CURRENT TEMPORAL SYSTEM_TIME',\n 'SET ENCRYPTION PASSWORD',\n 'SET PATH',\n 'SET SCHEMA',\n 'SET SESSION TIME ZONE',\n 'SIGNAL',\n 'TRUNCATE',\n 'UPDATE',\n 'VALUES',\n 'VALUES INTO',\n 'WHENEVER',\n // other\n 'ADD',\n 'ALTER COLUMN', // verify\n 'AFTER',\n 'DROP TABLE', // verify\n 'FETCH FIRST',\n 'FROM',\n 'GROUP BY',\n 'GO',\n 'HAVING',\n 'INSERT INTO',\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'SELECT',\n 'SET CURRENT SCHEMA',\n 'WHERE',\n 'WITH',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE', 'ELSEIF'];\n\n// https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/db2/rbafzintro.htm\nexport default class Db2Formatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR'];\n static fullReservedWords = dedupe([\n ...Object.values(reservedFunctions).reduce((acc, arr) => [...acc, ...arr], []),\n ...Object.values(reservedKeywords).reduce((acc, arr) => [...acc, ...arr], []),\n ]);\n\n static stringTypes: StringPatternType[] = [`\"\"`, \"''\", '``', '[]', \"x''\"];\n static blockStart = ['('];\n static blockEnd = [')'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = [':'];\n static lineCommentTypes = ['--'];\n static specialWordChars = { any: '#@' };\n static operators = ['**', '!>', '!<', '||'];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: Db2Formatter.reservedCommands,\n reservedBinaryCommands: Db2Formatter.reservedBinaryCommands,\n reservedDependentClauses: Db2Formatter.reservedDependentClauses,\n reservedJoinConditions: Db2Formatter.reservedJoinConditions,\n reservedLogicalOperators: Db2Formatter.reservedLogicalOperators,\n reservedKeywords: Db2Formatter.fullReservedWords,\n stringTypes: Db2Formatter.stringTypes,\n blockStart: Db2Formatter.blockStart,\n blockEnd: Db2Formatter.blockEnd,\n indexedPlaceholderTypes: Db2Formatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: Db2Formatter.namedPlaceholderTypes,\n lineCommentTypes: Db2Formatter.lineCommentTypes,\n specialWordChars: Db2Formatter.specialWordChars,\n operators: Db2Formatter.operators,\n });\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\n// https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF\nconst reservedFunctions = {\n math: [\n 'ABS',\n 'ACOS',\n 'ASIN',\n 'ATAN',\n 'BIN',\n 'BROUND',\n 'CBRT',\n 'CEIL',\n 'CEILING',\n 'CONV',\n 'COS',\n 'DEGREES',\n // 'E',\n 'EXP',\n 'FACTORIAL',\n 'FLOOR',\n 'GREATEST',\n 'HEX',\n 'LEAST',\n 'LN',\n 'LOG',\n 'LOG10',\n 'LOG2',\n 'NEGATIVE',\n 'PI',\n 'PMOD',\n 'POSITIVE',\n 'POW',\n 'POWER',\n 'RADIANS',\n 'RAND',\n 'ROUND',\n 'SHIFTLEFT',\n 'SHIFTRIGHT',\n 'SHIFTRIGHTUNSIGNED',\n 'SIGN',\n 'SIN',\n 'SQRT',\n 'TAN',\n 'UNHEX',\n 'WIDTH_BUCKET',\n ],\n array: ['ARRAY_CONTAINS', 'MAP_KEYS', 'MAP_VALUES', 'SIZE', 'SORT_ARRAY'],\n conversion: ['BINARY', 'CAST'],\n date: [\n 'ADD_MONTHS',\n 'DATE',\n 'DATE_ADD',\n 'DATE_FORMAT',\n 'DATE_SUB',\n 'DATEDIFF',\n 'DAY',\n 'DAYNAME',\n 'DAYOFMONTH',\n 'DAYOFYEAR',\n 'EXTRACT',\n 'FROM_UNIXTIME',\n 'FROM_UTC_TIMESTAMP',\n 'HOUR',\n 'LAST_DAY',\n 'MINUTE',\n 'MONTH',\n 'MONTHS_BETWEEN',\n 'NEXT_DAY',\n 'QUARTER',\n 'SECOND',\n 'TIMESTAMP',\n 'TO_DATE',\n 'TO_UTC_TIMESTAMP',\n 'TRUNC',\n 'UNIX_TIMESTAMP',\n 'WEEKOFYEAR',\n 'YEAR',\n ],\n conditional: ['ASSERT_TRUE', 'COALESCE', 'IF', 'ISNOTNULL', 'ISNULL', 'NULLIF', 'NVL'],\n string: [\n 'ASCII',\n 'BASE64',\n 'CHARACTER_LENGTH',\n 'CHR',\n 'CONCAT',\n 'CONCAT_WS',\n 'CONTEXT_NGRAMS',\n 'DECODE',\n 'ELT',\n 'ENCODE',\n 'FIELD',\n 'FIND_IN_SET',\n 'FORMAT_NUMBER',\n 'GET_JSON_OBJECT',\n 'IN_FILE',\n 'INITCAP',\n 'INSTR',\n 'LCASE',\n 'LENGTH',\n 'LEVENSHTEIN',\n 'LOCATE',\n 'LOWER',\n 'LPAD',\n 'LTRIM',\n 'NGRAMS',\n 'OCTET_LENGTH',\n 'PARSE_URL',\n 'PRINTF',\n 'QUOTE',\n 'REGEXP_EXTRACT',\n 'REGEXP_REPLACE',\n 'REPEAT',\n 'REVERSE',\n 'RPAD',\n 'RTRIM',\n 'SENTENCES',\n 'SOUNDEX',\n 'SPACE',\n 'SPLIT',\n 'STR_TO_MAP',\n 'SUBSTR',\n 'SUBSTRING',\n 'TRANSLATE',\n 'TRIM',\n 'UCASE',\n 'UNBASE64',\n 'UPPER',\n ],\n masking: [\n 'MASK',\n 'MASK_FIRST_N',\n 'MASK_HASH',\n 'MASK_LAST_N',\n 'MASK_SHOW_FIRST_N',\n 'MASK_SHOW_LAST_N',\n ],\n misc: [\n 'AES_DECRYPT',\n 'AES_ENCRYPT',\n 'CRC32',\n 'CURRENT_DATABASE',\n 'CURRENT_USER',\n 'HASH',\n 'JAVA_METHOD',\n 'LOGGED_IN_USER',\n 'MD5',\n 'REFLECT',\n 'SHA',\n 'SHA1',\n 'SHA2',\n 'SURROGATE_KEY',\n 'VERSION',\n ],\n aggregate: [\n 'AVG',\n 'COLLECT_LIST',\n 'COLLECT_SET',\n 'CORR',\n 'COUNT',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'HISTOGRAM_NUMERIC',\n 'MAX',\n 'MIN',\n 'NTILE',\n 'PERCENTILE',\n 'PERCENTILE_APPROX',\n 'REGR_AVGX',\n 'REGR_AVGY',\n 'REGR_COUNT',\n 'REGR_INTERCEPT',\n 'REGR_R2',\n 'REGR_SLOPE',\n 'REGR_SXX',\n 'REGR_SXY',\n 'REGR_SYY',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'SUM',\n 'VAR_POP',\n 'VAR_SAMP',\n 'VARIANCE',\n ],\n table: ['EXPLODE', 'INLINE', 'JSON_TUPLE', 'PARSE_URL_TUPLE', 'POSEXPLODE', 'STACK'],\n};\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\n// https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl\nconst reservedKeywords = {\n // Non-reserved keywords have proscribed meanings in. HiveQL, but can still be used as table or column names\n nonReserved: [\n 'ADD',\n 'ADMIN',\n 'AFTER',\n 'ANALYZE',\n 'ARCHIVE',\n 'ASC',\n 'BEFORE',\n 'BUCKET',\n 'BUCKETS',\n 'CASCADE',\n 'CHANGE',\n 'CLUSTER',\n 'CLUSTERED',\n 'CLUSTERSTATUS',\n 'COLLECTION',\n 'COLUMNS',\n 'COMMENT',\n 'COMPACT',\n 'COMPACTIONS',\n 'COMPUTE',\n 'CONCATENATE',\n 'CONTINUE',\n 'DATA',\n 'DATABASES',\n 'DATETIME',\n 'DAY',\n 'DBPROPERTIES',\n 'DEFERRED',\n 'DEFINED',\n 'DELIMITED',\n 'DEPENDENCY',\n 'DESC',\n 'DIRECTORIES',\n 'DIRECTORY',\n 'DISABLE',\n 'DISTRIBUTE',\n 'ELEM_TYPE',\n 'ENABLE',\n 'ESCAPED',\n 'EXCLUSIVE',\n 'EXPLAIN',\n 'EXPORT',\n 'FIELDS',\n 'FILE',\n 'FILEFORMAT',\n 'FIRST',\n 'FORMAT',\n 'FORMATTED',\n 'FUNCTIONS',\n 'HOLD_DDLTIME',\n 'HOUR',\n 'IDXPROPERTIES',\n 'IGNORE',\n 'INDEX',\n 'INDEXES',\n 'INPATH',\n 'INPUTDRIVER',\n 'INPUTFORMAT',\n 'ITEMS',\n 'JAR',\n 'KEYS',\n 'KEY_TYPE',\n 'LIMIT',\n 'LINES',\n 'LOAD',\n 'LOCATION',\n 'LOCK',\n 'LOCKS',\n 'LOGICAL',\n 'LONG',\n 'MAPJOIN',\n 'MATERIALIZED',\n 'METADATA',\n 'MINUS',\n 'MINUTE',\n 'MONTH',\n 'MSCK',\n 'NOSCAN',\n 'NO_DROP',\n 'OFFLINE',\n 'OPTION',\n 'OUTPUTDRIVER',\n 'OUTPUTFORMAT',\n 'OVERWRITE',\n 'OWNER',\n 'PARTITIONED',\n 'PARTITIONS',\n 'PLUS',\n 'PRETTY',\n 'PRINCIPALS',\n 'PROTECTION',\n 'PURGE',\n 'READ',\n 'READONLY',\n 'REBUILD',\n 'RECORDREADER',\n 'RECORDWRITER',\n 'RELOAD',\n 'RENAME',\n 'REPAIR',\n 'REPLACE',\n 'REPLICATION',\n 'RESTRICT',\n 'REWRITE',\n 'ROLE',\n 'ROLES',\n 'SCHEMA',\n 'SCHEMAS',\n 'SECOND',\n 'SEMI',\n 'SERDE',\n 'SERDEPROPERTIES',\n 'SERVER',\n 'SETS',\n 'SHARED',\n 'SHOW',\n 'SHOW_DATABASE',\n 'SKEWED',\n 'SORT',\n 'SORTED',\n 'SSL',\n 'STATISTICS',\n 'STORED',\n 'STREAMTABLE',\n 'STRING',\n 'STRUCT',\n 'TABLES',\n 'TBLPROPERTIES',\n 'TEMPORARY',\n 'TERMINATED',\n 'TINYINT',\n 'TOUCH',\n 'TRANSACTIONS',\n 'UNARCHIVE',\n 'UNDO',\n 'UNIONTYPE',\n 'UNLOCK',\n 'UNSET',\n 'UNSIGNED',\n 'URI',\n // 'USE',\n 'UTC',\n 'UTCTIMESTAMP',\n 'VALUE_TYPE',\n 'VIEW',\n 'WHILE',\n 'YEAR',\n 'AUTOCOMMIT',\n 'ISOLATION',\n 'LEVEL',\n 'OFFSET',\n 'SNAPSHOT',\n 'TRANSACTION',\n 'WORK',\n 'WRITE',\n 'ABORT',\n 'KEY',\n 'LAST',\n 'NORELY',\n 'NOVALIDATE',\n 'NULLS',\n 'RELY',\n 'VALIDATE',\n 'DETAIL',\n 'DOW',\n 'EXPRESSION',\n 'OPERATOR',\n 'QUARTER',\n 'SUMMARY',\n 'VECTORIZATION',\n 'WEEK',\n 'YEARS',\n 'MONTHS',\n 'WEEKS',\n 'DAYS',\n 'HOURS',\n 'MINUTES',\n 'SECONDS',\n 'TIMESTAMPTZ',\n 'ZONE',\n ],\n reserved: [\n // reserved\n 'ALL',\n // 'ALTER',\n // 'AND',\n 'ARRAY',\n 'AS',\n 'AUTHORIZATION',\n 'BETWEEN',\n 'BIGINT',\n 'BINARY',\n 'BOOLEAN',\n 'BOTH',\n 'BY',\n // 'CASE',\n 'CAST',\n 'CHAR',\n 'COLUMN',\n 'CONF',\n // 'CREATE',\n 'CROSS',\n 'CUBE',\n 'CURRENT',\n 'CURRENT_DATE',\n 'CURRENT_TIMESTAMP',\n 'CURSOR',\n 'DATABASE',\n 'DATE',\n 'DECIMAL',\n 'DELETE',\n // 'DESCRIBE',\n 'DISTINCT',\n 'DOUBLE',\n // 'DROP',\n // 'ELSE',\n // 'END',\n 'EXCHANGE',\n 'EXISTS',\n 'EXTENDED',\n 'EXTERNAL',\n 'FALSE',\n // 'FETCH',\n 'FLOAT',\n 'FOLLOWING',\n 'FOR',\n // 'FROM',\n 'FULL',\n 'FUNCTION',\n 'GRANT',\n // 'GROUP',\n 'GROUPING',\n // 'HAVING',\n 'IF',\n 'IMPORT',\n 'IN',\n 'INNER',\n // 'INSERT',\n 'INT',\n // 'INTERSECT',\n 'INTERVAL',\n 'INTO',\n 'IS',\n // 'JOIN',\n 'LATERAL',\n 'LEFT',\n 'LESS',\n 'LIKE',\n 'LOCAL',\n 'MACRO',\n 'MAP',\n 'MORE',\n 'NONE',\n 'NOT',\n 'NULL',\n 'OF',\n // 'ON',\n // 'OR',\n 'ORDER',\n 'OUT',\n 'OUTER',\n 'OVER',\n 'PARTIALSCAN',\n 'PARTITION',\n 'PERCENT',\n 'PRECEDING',\n 'PRESERVE',\n 'PROCEDURE',\n 'RANGE',\n 'READS',\n 'REDUCE',\n 'REVOKE',\n 'RIGHT',\n 'ROLLUP',\n 'ROW',\n 'ROWS',\n // 'SELECT',\n 'SET',\n 'SMALLINT',\n 'TABLE',\n 'TABLESAMPLE',\n 'THEN',\n 'TIMESTAMP',\n 'TO',\n 'TRANSFORM',\n 'TRIGGER',\n 'TRUE',\n // 'TRUNCATE',\n 'UNBOUNDED',\n // 'UNION',\n 'UNIQUEJOIN',\n // 'UPDATE',\n 'USER',\n 'UTC_TMESTAMP',\n // 'VALUES',\n 'VARCHAR',\n // 'WHEN',\n // 'WHERE',\n 'WINDOW',\n // 'WITH',\n 'COMMIT',\n 'ONLY',\n 'REGEXP',\n 'RLIKE',\n 'ROLLBACK',\n 'START',\n 'CACHE',\n 'CONSTRAINT',\n 'FOREIGN',\n 'PRIMARY',\n 'REFERENCES',\n 'DAYOFWEEK',\n 'EXTRACT',\n 'FLOOR',\n 'INTEGER',\n 'PRECISION',\n 'VIEWS',\n 'TIME',\n 'NUMERIC',\n 'SYNC',\n ],\n fileTypes: [\n 'TEXTFILE',\n 'SEQUENCEFILE',\n 'ORC',\n 'CSV',\n 'TSV',\n 'PARQUET',\n 'AVRO',\n 'RCFILE',\n 'JSONFILE',\n 'INPUTFORMAT',\n 'OUTPUTFORMAT',\n ],\n};\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\nconst reservedCommands = [\n // commands\n 'ALTER',\n 'ALTER COLUMN', // added\n 'ALTER TABLE', // added\n 'CREATE',\n 'CREATE TABLE', // added\n 'USE',\n 'DESCRIBE',\n 'DROP',\n 'DROP TABLE', // added\n 'FETCH',\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'INSERT',\n 'INSERT INTO', // added\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'SELECT',\n 'SET',\n 'SET SCHEMA', // added\n 'SHOW',\n 'SORT BY',\n 'TRUNCATE',\n 'UPDATE',\n 'VALUES',\n 'WHERE',\n 'WITH',\n\n // newline keywords\n 'STORED AS',\n 'STORED BY',\n 'ROW FORMAT',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous 'Statement', must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\n// https://cwiki.apache.org/confluence/display/Hive/LanguageManual\nexport default class HiveFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR'];\n static fullReservedWords = dedupe([\n ...Object.values(reservedFunctions).reduce((acc, arr) => [...acc, ...arr], []),\n ...Object.values(reservedKeywords).reduce((acc, arr) => [...acc, ...arr], []),\n ]);\n\n static stringTypes: StringPatternType[] = ['\"\"', \"''\", '``'];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = [];\n static lineCommentTypes = ['--'];\n static specialWordChars = {};\n static operators = ['<=>', '==', '||'];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: HiveFormatter.reservedCommands,\n reservedBinaryCommands: HiveFormatter.reservedBinaryCommands,\n reservedDependentClauses: HiveFormatter.reservedDependentClauses,\n reservedJoinConditions: HiveFormatter.reservedJoinConditions,\n reservedLogicalOperators: HiveFormatter.reservedLogicalOperators,\n reservedKeywords: HiveFormatter.fullReservedWords,\n stringTypes: HiveFormatter.stringTypes,\n blockStart: HiveFormatter.blockStart,\n blockEnd: HiveFormatter.blockEnd,\n indexedPlaceholderTypes: HiveFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: HiveFormatter.namedPlaceholderTypes,\n lineCommentTypes: HiveFormatter.lineCommentTypes,\n specialWordChars: HiveFormatter.specialWordChars,\n operators: HiveFormatter.operators,\n });\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport { isToken, Token, TokenType } from '../core/token';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\n// https://mariadb.com/kb/en/information-schema-sql_functions-table/\nconst reservedFunctions = [\n 'ADDDATE',\n 'ADD_MONTHS',\n 'BIT_AND',\n 'BIT_OR',\n 'BIT_XOR',\n 'CAST',\n 'COUNT',\n 'CUME_DIST',\n 'CURDATE',\n 'CURTIME',\n 'DATE_ADD',\n 'DATE_SUB',\n 'DATE_FORMAT',\n 'DECODE',\n 'DENSE_RANK',\n 'EXTRACT',\n 'FIRST_VALUE',\n 'GROUP_CONCAT',\n 'JSON_ARRAYAGG',\n 'JSON_OBJECTAGG',\n 'LAG',\n 'LEAD',\n 'MAX',\n 'MEDIAN',\n 'MID',\n 'MIN',\n 'NOW',\n 'NTH_VALUE',\n 'NTILE',\n 'POSITION',\n 'PERCENT_RANK',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'RANK',\n 'ROW_NUMBER',\n 'SESSION_USER',\n 'STD',\n 'STDDEV',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'SUBDATE',\n 'SUBSTR',\n 'SUBSTRING',\n 'SUM',\n 'SYSTEM_USER',\n 'TRIM',\n 'TRIM_ORACLE',\n 'VARIANCE',\n 'VAR_POP',\n 'VAR_SAMP',\n 'ABS',\n 'ACOS',\n 'ADDTIME',\n 'AES_DECRYPT',\n 'AES_ENCRYPT',\n 'ASIN',\n 'ATAN',\n 'ATAN2',\n 'BENCHMARK',\n 'BIN',\n 'BINLOG_GTID_POS',\n 'BIT_COUNT',\n 'BIT_LENGTH',\n 'CEIL',\n 'CEILING',\n 'CHARACTER_LENGTH',\n 'CHAR_LENGTH',\n 'CHR',\n 'COERCIBILITY',\n 'COLUMN_CHECK',\n 'COLUMN_EXISTS',\n 'COLUMN_LIST',\n 'COLUMN_JSON',\n 'COMPRESS',\n 'CONCAT',\n 'CONCAT_OPERATOR_ORACLE',\n 'CONCAT_WS',\n 'CONNECTION_ID',\n 'CONV',\n 'CONVERT_TZ',\n 'COS',\n 'COT',\n 'CRC32',\n 'DATEDIFF',\n 'DAYNAME',\n 'DAYOFMONTH',\n 'DAYOFWEEK',\n 'DAYOFYEAR',\n 'DEGREES',\n 'DECODE_HISTOGRAM',\n 'DECODE_ORACLE',\n 'DES_DECRYPT',\n 'DES_ENCRYPT',\n 'ELT',\n 'ENCODE',\n 'ENCRYPT',\n 'EXP',\n 'EXPORT_SET',\n 'EXTRACTVALUE',\n 'FIELD',\n 'FIND_IN_SET',\n 'FLOOR',\n 'FORMAT',\n 'FOUND_ROWS',\n 'FROM_BASE64',\n 'FROM_DAYS',\n 'FROM_UNIXTIME',\n 'GET_LOCK',\n 'GREATEST',\n 'HEX',\n 'IFNULL',\n 'INSTR',\n 'ISNULL',\n 'IS_FREE_LOCK',\n 'IS_USED_LOCK',\n 'JSON_ARRAY',\n 'JSON_ARRAY_APPEND',\n 'JSON_ARRAY_INSERT',\n 'JSON_COMPACT',\n 'JSON_CONTAINS',\n 'JSON_CONTAINS_PATH',\n 'JSON_DEPTH',\n 'JSON_DETAILED',\n 'JSON_EXISTS',\n 'JSON_EXTRACT',\n 'JSON_INSERT',\n 'JSON_KEYS',\n 'JSON_LENGTH',\n 'JSON_LOOSE',\n 'JSON_MERGE',\n 'JSON_MERGE_PATCH',\n 'JSON_MERGE_PRESERVE',\n 'JSON_QUERY',\n 'JSON_QUOTE',\n 'JSON_OBJECT',\n 'JSON_REMOVE',\n 'JSON_REPLACE',\n 'JSON_SET',\n 'JSON_SEARCH',\n 'JSON_TYPE',\n 'JSON_UNQUOTE',\n 'JSON_VALID',\n 'JSON_VALUE',\n 'LAST_DAY',\n 'LAST_INSERT_ID',\n 'LCASE',\n 'LEAST',\n 'LENGTH',\n 'LENGTHB',\n 'LN',\n 'LOAD_FILE',\n 'LOCATE',\n 'LOG',\n 'LOG10',\n 'LOG2',\n 'LOWER',\n 'LPAD',\n 'LPAD_ORACLE',\n 'LTRIM',\n 'LTRIM_ORACLE',\n 'MAKEDATE',\n 'MAKETIME',\n 'MAKE_SET',\n 'MASTER_GTID_WAIT',\n 'MASTER_POS_WAIT',\n 'MD5',\n 'MONTHNAME',\n 'NAME_CONST',\n 'NVL',\n 'NVL2',\n 'NULLIF',\n 'OCT',\n 'OCTET_LENGTH',\n 'ORD',\n 'PERIOD_ADD',\n 'PERIOD_DIFF',\n 'PI',\n 'POW',\n 'POWER',\n 'QUOTE',\n 'REGEXP_INSTR',\n 'REGEXP_REPLACE',\n 'REGEXP_SUBSTR',\n 'RADIANS',\n 'RAND',\n 'RELEASE_ALL_LOCKS',\n 'RELEASE_LOCK',\n 'REPLACE_ORACLE',\n 'REVERSE',\n 'ROUND',\n 'RPAD',\n 'RPAD_ORACLE',\n 'RTRIM',\n 'RTRIM_ORACLE',\n 'SEC_TO_TIME',\n 'SHA',\n 'SHA1',\n 'SHA2',\n 'SIGN',\n 'SIN',\n 'SLEEP',\n 'SOUNDEX',\n 'SPACE',\n 'SQRT',\n 'STRCMP',\n 'STR_TO_DATE',\n 'SUBSTR_ORACLE',\n 'SUBSTRING_INDEX',\n 'SUBTIME',\n 'SYS_GUID',\n 'TAN',\n 'TIMEDIFF',\n 'TIME_FORMAT',\n 'TIME_TO_SEC',\n 'TO_BASE64',\n 'TO_CHAR',\n 'TO_DAYS',\n 'TO_SECONDS',\n 'UCASE',\n 'UNCOMPRESS',\n 'UNCOMPRESSED_LENGTH',\n 'UNHEX',\n 'UNIX_TIMESTAMP',\n 'UPDATEXML',\n 'UPPER',\n 'UUID',\n 'UUID_SHORT',\n 'VERSION',\n 'WEEKDAY',\n 'WEEKOFYEAR',\n 'WSREP_LAST_WRITTEN_GTID',\n 'WSREP_LAST_SEEN_GTID',\n 'WSREP_SYNC_WAIT_UPTO_GTID',\n 'YEARWEEK',\n];\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\n// https://mariadb.com/kb/en/information-schema-keywords-table/\nconst reservedKeywords = [\n 'ACCESSIBLE',\n 'ACCOUNT',\n 'ACTION',\n 'ADMIN',\n 'AFTER',\n 'AGAINST',\n 'AGGREGATE',\n 'ALL',\n 'ALGORITHM',\n 'ALTER',\n 'ALWAYS',\n 'ANY',\n 'AS',\n 'ASC',\n 'ASCII',\n 'ASENSITIVE',\n 'AT',\n 'ATOMIC',\n 'AUTHORS',\n 'AUTO_INCREMENT',\n 'AUTOEXTEND_SIZE',\n 'AUTO',\n 'AVG',\n 'AVG_ROW_LENGTH',\n 'BACKUP',\n 'BEFORE',\n 'BETWEEN',\n 'BIGINT',\n 'BINARY',\n 'BIT',\n 'BLOB',\n 'BLOCK',\n 'BODY',\n 'BOOL',\n 'BOOLEAN',\n 'BOTH',\n 'BTREE',\n 'BY',\n 'BYTE',\n 'CACHE',\n 'CASCADE',\n 'CASCADED',\n 'CATALOG_NAME',\n 'CHAIN',\n 'CHANGE',\n 'CHANGED',\n 'CHAR',\n 'CHARACTER',\n 'CHARACTER SET',\n 'CHARSET',\n 'CHECK',\n 'CHECKPOINT',\n 'CHECKSUM',\n 'CIPHER',\n 'CLASS_ORIGIN',\n 'CLIENT',\n 'CLOB',\n 'CLOSE',\n 'COALESCE',\n 'CODE',\n 'COLLATE',\n 'COLLATION',\n 'COLUMN',\n 'COLUMN_NAME',\n 'COLUMNS',\n 'COLUMN_ADD',\n 'COLUMN_CREATE',\n 'COLUMN_DELETE',\n 'COLUMN_GET',\n 'COMMENT',\n 'COMMITTED',\n 'COMPACT',\n 'COMPLETION',\n 'COMPRESSED',\n 'CONCURRENT',\n 'CONDITION',\n 'CONNECTION',\n 'CONSISTENT',\n 'CONSTRAINT',\n 'CONSTRAINT_CATALOG',\n 'CONSTRAINT_NAME',\n 'CONSTRAINT_SCHEMA',\n 'CONTAINS',\n 'CONTEXT',\n 'CONTINUE',\n 'CONTRIBUTORS',\n 'CONVERT',\n 'CPU',\n 'CREATE',\n 'CROSS',\n 'CUBE',\n 'CURRENT',\n 'CURRENT_DATE',\n 'CURRENT_POS',\n 'CURRENT_ROLE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_USER',\n 'CURSOR',\n 'CURSOR_NAME',\n 'CYCLE',\n 'DATA',\n 'DATABASE',\n 'DATABASES',\n 'DATAFILE',\n 'DATE',\n 'DATETIME',\n 'DAY',\n 'DAY_HOUR',\n 'DAY_MICROSECOND',\n 'DAY_MINUTE',\n 'DAY_SECOND',\n 'DEALLOCATE',\n 'DEC',\n 'DECIMAL',\n 'DECLARE',\n 'DEFAULT',\n 'DEFINER',\n 'DELAYED',\n 'DELAY_KEY_WRITE',\n 'DELETE_DOMAIN_ID',\n 'DES_KEY_FILE',\n 'DETERMINISTIC',\n 'DIAGNOSTICS',\n 'DIRECTORY',\n 'DISABLE',\n 'DISCARD',\n 'DISK',\n 'DISTINCT',\n 'DISTINCTROW',\n 'DIV',\n 'DOUBLE',\n 'DO_DOMAIN_IDS',\n 'DROP',\n 'DUAL',\n 'DUMPFILE',\n 'DUPLICATE',\n 'DYNAMIC',\n 'EACH',\n 'EMPTY',\n 'ENABLE',\n 'ENCLOSED',\n 'ENDS',\n 'ENGINE',\n 'ENGINES',\n 'ENUM',\n 'ERROR',\n 'ERRORS',\n 'ESCAPE',\n 'ESCAPED',\n 'EVENT',\n 'EVENTS',\n 'EVERY',\n 'EXAMINED',\n 'EXCHANGE',\n 'EXCLUDE',\n 'EXCEPTION',\n 'EXISTS',\n 'EXIT',\n 'EXPANSION',\n 'EXPIRE',\n 'EXPORT',\n 'EXTENDED',\n 'EXTENT_SIZE',\n 'FALSE',\n 'FAST',\n 'FAULTS',\n 'FEDERATED',\n 'FETCH',\n 'FIELDS',\n 'FILE',\n 'FIRST',\n 'FIXED',\n 'FLOAT',\n 'FLOAT4',\n 'FLOAT8',\n 'FOLLOWING',\n 'FOLLOWS',\n 'FOR',\n 'FORCE',\n 'FOREIGN',\n 'FOUND',\n 'FULL',\n 'FULLTEXT',\n 'FUNCTION',\n 'GENERAL',\n 'GENERATED',\n 'GET_FORMAT',\n 'GET',\n 'GLOBAL',\n 'GOTO',\n 'GRANTS',\n 'GROUP',\n 'HARD',\n 'HASH',\n 'HIGH_PRIORITY',\n 'HISTORY',\n 'HOST',\n 'HOSTS',\n 'HOUR',\n 'HOUR_MICROSECOND',\n 'HOUR_MINUTE',\n 'HOUR_SECOND',\n // 'ID',\n 'IDENTIFIED',\n 'IF',\n 'IGNORE',\n 'IGNORED',\n 'IGNORE_DOMAIN_IDS',\n 'IGNORE_SERVER_IDS',\n 'IMMEDIATE',\n 'IMPORT',\n 'IN',\n 'INCREMENT',\n 'INDEX',\n 'INDEXES',\n 'INFILE',\n 'INITIAL_SIZE',\n 'INNER',\n 'INOUT',\n 'INSENSITIVE',\n 'INSERT_METHOD',\n 'INSTALL',\n 'INT',\n 'INT1',\n 'INT2',\n 'INT3',\n 'INT4',\n 'INT8',\n 'INTEGER',\n 'INTERVAL',\n 'INVISIBLE',\n 'INTO',\n 'IO',\n 'IO_THREAD',\n 'IPC',\n 'IS',\n 'ISOLATION',\n 'ISOPEN',\n 'ISSUER',\n 'ITERATE',\n 'INVOKER',\n 'JSON',\n 'JSON_TABLE',\n 'KEY',\n 'KEYS',\n 'KEY_BLOCK_SIZE',\n 'LANGUAGE',\n 'LAST',\n 'LAST_VALUE',\n 'LASTVAL',\n 'LEADING',\n 'LEAVE',\n 'LEAVES',\n 'LEFT',\n 'LESS',\n 'LEVEL',\n 'LIKE',\n 'LINEAR',\n 'LINES',\n 'LIST',\n 'LOAD',\n 'LOCAL',\n 'LOCALTIME',\n 'LOCALTIMESTAMP',\n 'LOCK',\n 'LOCKED',\n 'LOCKS',\n 'LOGFILE',\n 'LOGS',\n 'LONG',\n 'LONGBLOB',\n 'LONGTEXT',\n 'LOOP',\n 'LOW_PRIORITY',\n 'MASTER',\n 'MASTER_CONNECT_RETRY',\n 'MASTER_DELAY',\n 'MASTER_GTID_POS',\n 'MASTER_HOST',\n 'MASTER_LOG_FILE',\n 'MASTER_LOG_POS',\n 'MASTER_PASSWORD',\n 'MASTER_PORT',\n 'MASTER_SERVER_ID',\n 'MASTER_SSL',\n 'MASTER_SSL_CA',\n 'MASTER_SSL_CAPATH',\n 'MASTER_SSL_CERT',\n 'MASTER_SSL_CIPHER',\n 'MASTER_SSL_CRL',\n 'MASTER_SSL_CRLPATH',\n 'MASTER_SSL_KEY',\n 'MASTER_SSL_VERIFY_SERVER_CERT',\n 'MASTER_USER',\n 'MASTER_USE_GTID',\n 'MASTER_HEARTBEAT_PERIOD',\n 'MATCH',\n 'MAX_CONNECTIONS_PER_HOUR',\n 'MAX_QUERIES_PER_HOUR',\n 'MAX_ROWS',\n 'MAX_SIZE',\n 'MAX_STATEMENT_TIME',\n 'MAX_UPDATES_PER_HOUR',\n 'MAX_USER_CONNECTIONS',\n 'MAXVALUE',\n 'MEDIUM',\n 'MEDIUMBLOB',\n 'MEDIUMINT',\n 'MEDIUMTEXT',\n 'MEMORY',\n 'MERGE',\n 'MESSAGE_TEXT',\n 'MICROSECOND',\n 'MIDDLEINT',\n 'MIGRATE',\n 'MINUS',\n 'MINUTE',\n 'MINUTE_MICROSECOND',\n 'MINUTE_SECOND',\n 'MINVALUE',\n 'MIN_ROWS',\n 'MOD',\n 'MODE',\n 'MODIFIES',\n 'MODIFY',\n 'MONITOR',\n 'MONTH',\n 'MUTEX',\n 'MYSQL',\n 'MYSQL_ERRNO',\n 'NAME',\n 'NAMES',\n 'NATIONAL',\n 'NATURAL',\n 'NCHAR',\n 'NESTED',\n 'NEVER',\n 'NEW',\n 'NEXT',\n 'NEXTVAL',\n 'NO',\n 'NOMAXVALUE',\n 'NOMINVALUE',\n 'NOCACHE',\n 'NOCYCLE',\n 'NO_WAIT',\n 'NOWAIT',\n 'NODEGROUP',\n 'NONE',\n 'NOT',\n 'NOTFOUND',\n 'NO_WRITE_TO_BINLOG',\n 'NULL',\n 'NUMBER',\n 'NUMERIC',\n 'NVARCHAR',\n 'OF',\n 'OFFSET',\n 'OLD_PASSWORD',\n 'ON DELETE',\n 'ON UPDATE',\n 'ONE',\n 'ONLINE',\n 'ONLY',\n 'OPEN',\n 'OPTIMIZE',\n 'OPTIONS',\n 'OPTION',\n 'OPTIONALLY',\n 'ORDER',\n 'ORDINALITY',\n 'OTHERS',\n 'OUT',\n 'OUTER',\n 'OUTFILE',\n 'OVER',\n 'OVERLAPS',\n 'OWNER',\n 'PACKAGE',\n 'PACK_KEYS',\n 'PAGE',\n 'PAGE_CHECKSUM',\n 'PARSER',\n 'PARSE_VCOL_EXPR',\n 'PATH',\n 'PERIOD',\n 'PARTIAL',\n 'PARTITION',\n 'PARTITIONING',\n 'PARTITIONS',\n 'PASSWORD',\n 'PERSISTENT',\n 'PHASE',\n 'PLUGIN',\n 'PLUGINS',\n 'PORT',\n 'PORTION',\n 'PRECEDES',\n 'PRECEDING',\n 'PRECISION',\n 'PRESERVE',\n 'PREV',\n 'PREVIOUS',\n 'PRIMARY',\n 'PRIVILEGES',\n 'PROCEDURE',\n 'PROCESS',\n 'PROCESSLIST',\n 'PROFILE',\n 'PROFILES',\n 'PROXY',\n 'PURGE',\n 'QUARTER',\n 'QUERY',\n 'QUICK',\n 'RAISE',\n 'RANGE',\n 'RAW',\n 'READ',\n 'READ_ONLY',\n 'READ_WRITE',\n 'READS',\n 'REAL',\n 'REBUILD',\n 'RECOVER',\n 'RECURSIVE',\n 'REDO_BUFFER_SIZE',\n 'REDOFILE',\n 'REDUNDANT',\n 'REFERENCES',\n 'REGEXP',\n 'RELAY',\n 'RELAYLOG',\n 'RELAY_LOG_FILE',\n 'RELAY_LOG_POS',\n 'RELAY_THREAD',\n 'RELEASE',\n 'RELOAD',\n 'REMOVE',\n 'RENAME',\n 'REORGANIZE',\n 'REPAIR',\n 'REPEATABLE',\n 'REPLAY',\n 'REPLICA',\n 'REPLICAS',\n 'REPLICA_POS',\n 'REPLICATION',\n 'REPEAT',\n 'REQUIRE',\n 'RESET',\n 'RESTART',\n 'RESTORE',\n 'RESTRICT',\n 'RESUME',\n 'RETURNED_SQLSTATE',\n 'RETURN',\n 'RETURNS',\n 'REUSE',\n 'RIGHT',\n 'RLIKE',\n 'ROLE',\n 'ROLLUP',\n 'ROUTINE',\n 'ROW',\n 'ROWCOUNT',\n 'ROWNUM',\n 'ROWS',\n 'ROWTYPE',\n 'ROW_COUNT',\n 'ROW_FORMAT',\n 'RTREE',\n 'SCHEDULE',\n 'SCHEMA',\n 'SCHEMA_NAME',\n 'SCHEMAS',\n 'SECOND',\n 'SECOND_MICROSECOND',\n 'SECURITY',\n 'SENSITIVE',\n 'SEPARATOR',\n 'SEQUENCE',\n 'SERIAL',\n 'SERIALIZABLE',\n 'SESSION',\n 'SERVER',\n 'SETVAL',\n 'SHARE',\n 'SIGNED',\n 'SIMPLE',\n 'SKIP',\n 'SLAVE',\n 'SLAVES',\n 'SLAVE_POS',\n 'SLOW',\n 'SNAPSHOT',\n 'SMALLINT',\n 'SOCKET',\n 'SOFT',\n 'SOME',\n 'SONAME',\n 'SOUNDS',\n 'SOURCE',\n 'STAGE',\n 'STORED',\n 'SPATIAL',\n 'SPECIFIC',\n 'REF_SYSTEM_ID',\n 'SQL',\n 'SQLEXCEPTION',\n 'SQLSTATE',\n 'SQLWARNING',\n 'SQL_BIG_RESULT',\n 'SQL_BUFFER_RESULT',\n 'SQL_CACHE',\n 'SQL_CALC_FOUND_ROWS',\n 'SQL_NO_CACHE',\n 'SQL_SMALL_RESULT',\n 'SQL_THREAD',\n 'SQL_TSI_SECOND',\n 'SQL_TSI_MINUTE',\n 'SQL_TSI_HOUR',\n 'SQL_TSI_DAY',\n 'SQL_TSI_WEEK',\n 'SQL_TSI_MONTH',\n 'SQL_TSI_QUARTER',\n 'SQL_TSI_YEAR',\n 'SSL',\n 'START',\n 'STARTING',\n 'STARTS',\n 'STATEMENT',\n 'STATS_AUTO_RECALC',\n 'STATS_PERSISTENT',\n 'STATS_SAMPLE_PAGES',\n 'STATUS',\n 'STOP',\n 'STORAGE',\n 'STRING',\n 'SUBCLASS_ORIGIN',\n 'SUBJECT',\n 'SUBPARTITION',\n 'SUBPARTITIONS',\n 'SUPER',\n 'SUSPEND',\n 'SWAPS',\n 'SWITCHES',\n 'SYSDATE',\n 'SYSTEM',\n 'SYSTEM_TIME',\n 'TABLE',\n 'TABLE_NAME',\n 'TABLES',\n 'TABLESPACE',\n 'TABLE_CHECKSUM',\n 'TEMPORARY',\n 'TEMPTABLE',\n 'TERMINATED',\n 'TEXT',\n 'THAN',\n 'THEN',\n 'TIES',\n 'TIME',\n 'TIMESTAMP',\n 'TIMESTAMPADD',\n 'TIMESTAMPDIFF',\n 'TINYBLOB',\n 'TINYINT',\n 'TINYTEXT',\n 'TO',\n 'TRAILING',\n 'TRANSACTION',\n 'TRANSACTIONAL',\n 'THREADS',\n 'TRIGGER',\n 'TRIGGERS',\n 'TRUE',\n 'TYPE',\n 'TYPES',\n 'UNBOUNDED',\n 'UNCOMMITTED',\n 'UNDEFINED',\n 'UNDO_BUFFER_SIZE',\n 'UNDOFILE',\n 'UNDO',\n 'UNICODE',\n 'UNIQUE',\n 'UNKNOWN',\n 'UNLOCK',\n 'UNINSTALL',\n 'UNSIGNED',\n 'UNTIL',\n 'UPGRADE',\n 'USAGE',\n 'USER',\n 'USER_RESOURCES',\n 'USE_FRM',\n 'UTC_DATE',\n 'UTC_TIME',\n 'UTC_TIMESTAMP',\n 'VALUE',\n 'VARBINARY',\n 'VARCHAR',\n 'VARCHARACTER',\n 'VARCHAR2',\n 'VARIABLES',\n 'VARYING',\n 'VIA',\n 'VIEW',\n 'VIRTUAL',\n 'VISIBLE',\n 'VERSIONING',\n 'WAIT',\n 'WARNINGS',\n 'WEEK',\n 'WEIGHT_STRING',\n 'WHILE',\n 'WINDOW',\n 'WITHIN',\n 'WITHOUT',\n 'WORK',\n 'WRAPPER',\n 'WRITE',\n 'X509',\n 'XA',\n 'XML',\n 'YEAR',\n 'YEAR_MONTH',\n 'ZEROFILL',\n];\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// https://mariadb.com/docs/reference/mdb/sql-statements/\nconst reservedCommands = [\n 'ALTER DATABASE',\n 'ALTER DATABASE COMMENT',\n 'ALTER EVENT',\n 'ALTER FUNCTION',\n 'ALTER PROCEDURE',\n 'ALTER SCHEMA',\n 'ALTER SCHEMA COMMENT',\n 'ALTER SEQUENCE',\n 'ALTER SERVER',\n 'ALTER TABLE',\n 'ALTER USER',\n 'ALTER VIEW',\n 'ANALYZE',\n 'ANALYZE TABLE',\n 'BACKUP LOCK',\n 'BACKUP STAGE',\n 'BACKUP UNLOCK',\n 'BEGIN',\n 'BINLOG',\n 'CACHE INDEX',\n 'CALL',\n 'CHANGE MASTER TO',\n 'CHECK TABLE',\n 'CHECK VIEW',\n 'CHECKSUM TABLE',\n 'COMMIT',\n 'CREATE AGGREGATE FUNCTION',\n 'CREATE DATABASE',\n 'CREATE EVENT',\n 'CREATE FUNCTION',\n 'CREATE INDEX',\n 'CREATE PROCEDURE',\n 'CREATE ROLE',\n 'CREATE SEQUENCE',\n 'CREATE SERVER',\n 'CREATE SPATIAL INDEX',\n 'CREATE TABLE',\n 'CREATE TRIGGER',\n 'CREATE UNIQUE INDEX',\n 'CREATE USER',\n 'CREATE VIEW',\n 'DEALLOCATE PREPARE',\n 'DELETE',\n 'DESC',\n 'DESCRIBE',\n 'DO',\n 'DROP DATABASE',\n 'DROP EVENT',\n 'DROP FUNCTION',\n 'DROP INDEX',\n 'DROP PREPARE',\n 'DROP PROCEDURE',\n 'DROP ROLE',\n 'DROP SEQUENCE',\n 'DROP SERVER',\n 'DROP TABLE',\n 'DROP TRIGGER',\n 'DROP USER',\n 'DROP VIEW',\n 'EXECUTE',\n 'EXPLAIN',\n 'FLUSH',\n 'GET DIAGNOSTICS',\n 'GET DIAGNOSTICS CONDITION',\n 'GRANT',\n 'HANDLER',\n 'HELP',\n 'INSERT',\n 'INSTALL PLUGIN',\n 'INSTALL SONAME',\n 'KILL',\n 'LOAD DATA INFILE',\n 'LOAD INDEX INTO CACHE',\n 'LOAD XML INFILE',\n 'LOCK TABLE',\n 'OPTIMIZE TABLE',\n 'PREPARE',\n 'PURGE BINARY LOGS',\n 'PURGE MASTER LOGS',\n 'RELEASE SAVEPOINT',\n 'RENAME TABLE',\n 'RENAME USER',\n 'REPAIR TABLE',\n 'REPAIR VIEW',\n 'REPLACE',\n 'RESET MASTER',\n 'RESET QUERY CACHE',\n 'RESET REPLICA',\n 'RESET SLAVE',\n 'RESIGNAL',\n 'RETURNING',\n 'REVOKE',\n 'ROLLBACK',\n 'SAVEPOINT',\n 'SELECT',\n 'SET',\n 'SET CHARACTER SET',\n 'SET DEFAULT ROLE',\n 'SET GLOBAL TRANSACTION',\n 'SET NAMES',\n 'SET PASSWORD',\n 'SET ROLE',\n 'SET STATEMENT',\n 'SET TRANSACTION',\n 'SHOW',\n 'SHOW ALL REPLICAS STATUS',\n 'SHOW ALL SLAVES STATUS',\n 'SHOW AUTHORS',\n 'SHOW BINARY LOGS',\n 'SHOW BINLOG EVENTS',\n 'SHOW BINLOG STATUS',\n 'SHOW CHARACTER SET',\n 'SHOW CLIENT_STATISTICS',\n 'SHOW COLLATION',\n 'SHOW COLUMNS',\n 'SHOW CONTRIBUTORS',\n 'SHOW CREATE DATABASE',\n 'SHOW CREATE EVENT',\n 'SHOW CREATE FUNCTION',\n 'SHOW CREATE PACKAGE',\n 'SHOW CREATE PACKAGE BODY',\n 'SHOW CREATE PROCEDURE',\n 'SHOW CREATE SEQUENCE',\n 'SHOW CREATE TABLE',\n 'SHOW CREATE TRIGGER',\n 'SHOW CREATE USER',\n 'SHOW CREATE VIEW',\n 'SHOW DATABASES',\n 'SHOW ENGINE',\n 'SHOW ENGINE INNODB STATUS',\n 'SHOW ENGINES',\n 'SHOW ERRORS',\n 'SHOW EVENTS',\n 'SHOW EXPLAIN',\n 'SHOW FUNCTION CODE',\n 'SHOW FUNCTION STATUS',\n 'SHOW GRANTS',\n 'SHOW INDEX',\n 'SHOW INDEXES',\n 'SHOW INDEX_STATISTICS',\n 'SHOW KEYS',\n 'SHOW LOCALES',\n 'SHOW MASTER LOGS',\n 'SHOW MASTER STATUS',\n 'SHOW OPEN TABLES',\n 'SHOW PACKAGE BODY CODE',\n 'SHOW PACKAGE BODY STATUS',\n 'SHOW PACKAGE STATUS',\n 'SHOW PLUGINS',\n 'SHOW PLUGINS SONAME',\n 'SHOW PRIVILEGES',\n 'SHOW PROCEDURE CODE',\n 'SHOW PROCEDURE STATUS',\n 'SHOW PROCESSLIST',\n 'SHOW PROFILE',\n 'SHOW PROFILES',\n 'SHOW QUERY_RESPONSE_TIME',\n 'SHOW RELAYLOG EVENTS',\n 'SHOW REPLICA',\n 'SHOW REPLICA HOSTS',\n 'SHOW REPLICA STATUS',\n 'SHOW SCHEMAS',\n 'SHOW SLAVE',\n 'SHOW SLAVE HOSTS',\n 'SHOW SLAVE STATUS',\n 'SHOW STATUS',\n 'SHOW STORAGE ENGINES',\n 'SHOW TABLE STATUS',\n 'SHOW TABLES',\n 'SHOW TRIGGERS',\n 'SHOW USER_STATISTICS',\n 'SHOW VARIABLES',\n 'SHOW WARNINGS',\n 'SHOW WSREP_MEMBERSHIP',\n 'SHOW WSREP_STATUS',\n 'SHUTDOWN',\n 'SIGNAL',\n 'START ALL REPLICAS',\n 'START ALL SLAVES',\n 'START REPLICA',\n 'START SLAVE',\n 'START TRANSACTION',\n 'STOP ALL REPLICAS',\n 'STOP ALL SLAVES',\n 'STOP REPLICA',\n 'STOP SLAVE',\n 'TRUNCATE',\n 'TRUNCATE TABLE',\n 'UNINSTALL PLUGIN',\n 'UNINSTALL SONAME',\n 'UNLOCK TABLE',\n 'UPDATE',\n 'USE',\n 'WITH',\n 'XA BEGIN',\n 'XA COMMIT',\n 'XA END',\n 'XA PREPARE',\n 'XA RECOVER',\n 'XA ROLLBACK',\n 'XA START',\n // other\n 'ADD',\n 'ALTER COLUMN',\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'INSERT INTO',\n 'INSERT',\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'SELECT',\n 'VALUES',\n 'WHERE',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n 'MINUS',\n 'MINUS ALL',\n 'MINUS DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n // non-standard joins\n 'STRAIGHT_JOIN',\n 'NATURAL LEFT JOIN',\n 'NATURAL LEFT OUTER JOIN',\n 'NATURAL RIGHT JOIN',\n 'NATURAL RIGHT OUTER JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE', 'ELSEIF', 'ELSIF'];\n\n// For reference: https://mariadb.com/kb/en/sql-statements-structure/\nexport default class MariaDbFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR', 'XOR'];\n static reservedDependentClauses = reservedDependentClauses;\n static reservedKeywords = dedupe([...reservedKeywords, ...reservedFunctions]);\n static stringTypes: StringPatternType[] = ['``', \"''\", '\"\"'];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = [];\n static lineCommentTypes = ['--', '#'];\n static specialWordChars = { prefix: '@' };\n static operators = [':=', '<<', '>>', '<=>', '&&', '||'];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: MariaDbFormatter.reservedCommands,\n reservedBinaryCommands: MariaDbFormatter.reservedBinaryCommands,\n reservedDependentClauses: MariaDbFormatter.reservedDependentClauses,\n reservedJoinConditions: MariaDbFormatter.reservedJoinConditions,\n reservedLogicalOperators: MariaDbFormatter.reservedLogicalOperators,\n reservedKeywords: MariaDbFormatter.reservedKeywords,\n stringTypes: MariaDbFormatter.stringTypes,\n blockStart: MariaDbFormatter.blockStart,\n blockEnd: MariaDbFormatter.blockEnd,\n indexedPlaceholderTypes: MariaDbFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: MariaDbFormatter.namedPlaceholderTypes,\n lineCommentTypes: MariaDbFormatter.lineCommentTypes,\n specialWordChars: MariaDbFormatter.specialWordChars,\n operators: MariaDbFormatter.operators,\n });\n }\n\n tokenOverride(token: Token) {\n // [SET] ( ...\n if (isToken.SET(token) && this.tokenLookAhead().value === '(') {\n // This is SET datatype, not SET statement\n return { type: TokenType.RESERVED_KEYWORD, value: token.value };\n }\n\n return token;\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport { isToken, Token, TokenType } from '../core/token';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n// TODO: split this into object with function categories\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\n// https://dev.mysql.com/doc/refman/8.0/en/built-in-function-reference.html\nconst reservedFunctions = [\n 'ABS',\n 'ACOS',\n 'ADDDATE',\n 'ADDTIME',\n 'AES_DECRYPT',\n 'AES_ENCRYPT',\n 'AND',\n 'ANY_VALUE',\n 'ASCII',\n 'ASIN',\n 'ATAN',\n 'ATAN2',\n 'AVG',\n 'BENCHMARK',\n 'BIN',\n 'BIN_TO_UUID',\n 'BINARY',\n 'BIT_AND',\n 'BIT_COUNT',\n 'BIT_LENGTH',\n 'BIT_OR',\n 'BIT_XOR',\n 'CAN_ACCESS_COLUMN',\n 'CAN_ACCESS_DATABASE',\n 'CAN_ACCESS_TABLE',\n 'CAN_ACCESS_USER',\n 'CAN_ACCESS_VIEW',\n 'CASE',\n 'CAST',\n 'CEIL',\n 'CEILING',\n 'CHAR',\n 'CHAR_LENGTH',\n 'CHARACTER_LENGTH',\n 'CHARSET',\n 'COALESCE',\n 'COERCIBILITY',\n 'COLLATION',\n 'COMPRESS',\n 'CONCAT',\n 'CONCAT_WS',\n 'CONNECTION_ID',\n 'CONV',\n 'CONVERT',\n 'CONVERT_TZ',\n 'COS',\n 'COT',\n 'COUNT',\n 'CRC32',\n 'CUME_DIST',\n 'CURDATE',\n 'CURRENT_DATE',\n 'CURRENT_ROLE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_USER',\n 'CURTIME',\n 'DATABASE',\n 'DATE',\n 'DATE_ADD',\n 'DATE_FORMAT',\n 'DATE_SUB',\n 'DATEDIFF',\n 'DAY',\n 'DAYNAME',\n 'DAYOFMONTH',\n 'DAYOFWEEK',\n 'DAYOFYEAR',\n 'DEFAULT',\n 'DEGREES',\n 'DENSE_RANK',\n 'DIV',\n 'ELT',\n 'EXP',\n 'EXPORT_SET',\n 'EXTRACT',\n 'ExtractValue',\n 'FIELD',\n 'FIND_IN_SET',\n 'FIRST_VALUE',\n 'FLOOR',\n 'FORMAT',\n 'FORMAT_BYTES',\n 'FORMAT_PICO_TIME',\n 'FOUND_ROWS',\n 'FROM_BASE64',\n 'FROM_DAYS',\n 'FROM_UNIXTIME',\n 'GeomCollection',\n 'GeometryCollection',\n 'GET_DD_COLUMN_PRIVILEGES',\n 'GET_DD_CREATE_OPTIONS',\n 'GET_DD_INDEX_SUB_PART_LENGTH',\n 'GET_FORMAT',\n 'GET_LOCK',\n 'GREATEST',\n 'GROUP_CONCAT',\n 'GROUPING',\n 'GTID_SUBSET',\n 'GTID_SUBTRACT',\n 'HEX',\n 'HOUR',\n 'ICU_VERSION',\n 'IF',\n 'IFNULL',\n 'IN',\n 'INET_ATON',\n 'INET_NTOA',\n 'INET6_ATON',\n 'INET6_NTOA',\n 'INSERT',\n 'INSTR',\n 'INTERNAL_AUTO_INCREMENT',\n 'INTERNAL_AVG_ROW_LENGTH',\n 'INTERNAL_CHECK_TIME',\n 'INTERNAL_CHECKSUM',\n 'INTERNAL_DATA_FREE',\n 'INTERNAL_DATA_LENGTH',\n 'INTERNAL_DD_CHAR_LENGTH',\n 'INTERNAL_GET_COMMENT_OR_ERROR',\n 'INTERNAL_GET_ENABLED_ROLE_JSON',\n 'INTERNAL_GET_HOSTNAME',\n 'INTERNAL_GET_USERNAME',\n 'INTERNAL_GET_VIEW_WARNING_OR_ERROR',\n 'INTERNAL_INDEX_COLUMN_CARDINALITY',\n 'INTERNAL_INDEX_LENGTH',\n 'INTERNAL_IS_ENABLED_ROLE',\n 'INTERNAL_IS_MANDATORY_ROLE',\n 'INTERNAL_KEYS_DISABLED',\n 'INTERNAL_MAX_DATA_LENGTH',\n 'INTERNAL_TABLE_ROWS',\n 'INTERNAL_UPDATE_TIME',\n 'INTERVAL',\n 'IS',\n 'IS_FREE_LOCK',\n 'IS_IPV4',\n 'IS_IPV4_COMPAT',\n 'IS_IPV4_MAPPED',\n 'IS_IPV6',\n 'IS NOT',\n 'IS NOT NULL',\n 'IS NULL',\n 'IS_USED_LOCK',\n 'IS_UUID',\n 'ISNULL',\n 'JSON_ARRAY',\n 'JSON_ARRAY_APPEND',\n 'JSON_ARRAY_INSERT',\n 'JSON_ARRAYAGG',\n 'JSON_CONTAINS',\n 'JSON_CONTAINS_PATH',\n 'JSON_DEPTH',\n 'JSON_EXTRACT',\n 'JSON_INSERT',\n 'JSON_KEYS',\n 'JSON_LENGTH',\n 'JSON_MERGE',\n 'JSON_MERGE_PATCH',\n 'JSON_MERGE_PRESERVE',\n 'JSON_OBJECT',\n 'JSON_OBJECTAGG',\n 'JSON_OVERLAPS',\n 'JSON_PRETTY',\n 'JSON_QUOTE',\n 'JSON_REMOVE',\n 'JSON_REPLACE',\n 'JSON_SCHEMA_VALID',\n 'JSON_SCHEMA_VALIDATION_REPORT',\n 'JSON_SEARCH',\n 'JSON_SET',\n 'JSON_STORAGE_FREE',\n 'JSON_STORAGE_SIZE',\n 'JSON_TABLE',\n 'JSON_TYPE',\n 'JSON_UNQUOTE',\n 'JSON_VALID',\n 'JSON_VALUE',\n 'LAG',\n 'LAST_DAY',\n 'LAST_INSERT_ID',\n 'LAST_VALUE',\n 'LCASE',\n 'LEAD',\n 'LEAST',\n 'LEFT',\n 'LENGTH',\n 'LIKE',\n 'LineString',\n 'LN',\n 'LOAD_FILE',\n 'LOCALTIME',\n 'LOCALTIMESTAMP',\n 'LOCATE',\n 'LOG',\n 'LOG10',\n 'LOG2',\n 'LOWER',\n 'LPAD',\n 'LTRIM',\n 'MAKE_SET',\n 'MAKEDATE',\n 'MAKETIME',\n 'MASTER_POS_WAIT',\n 'MATCH',\n 'MAX',\n 'MBRContains',\n 'MBRCoveredBy',\n 'MBRCovers',\n 'MBRDisjoint',\n 'MBREquals',\n 'MBRIntersects',\n 'MBROverlaps',\n 'MBRTouches',\n 'MBRWithin',\n 'MD5',\n 'MEMBER OF',\n 'MICROSECOND',\n 'MID',\n 'MIN',\n 'MINUTE',\n 'MOD',\n 'MONTH',\n 'MONTHNAME',\n 'MultiLineString',\n 'MultiPoint',\n 'MultiPolygon',\n 'NAME_CONST',\n 'NOT',\n 'NOT IN',\n 'NOT LIKE',\n 'NOT REGEXP',\n 'NOW',\n 'NTH_VALUE',\n 'NTILE',\n 'NULLIF',\n 'OCT',\n 'OCTET_LENGTH',\n 'OR',\n 'ORD',\n 'PERCENT_RANK',\n 'PERIOD_ADD',\n 'PERIOD_DIFF',\n 'PI',\n 'Point',\n 'Polygon',\n 'POSITION',\n 'POW',\n 'POWER',\n 'PS_CURRENT_THREAD_ID',\n 'PS_THREAD_ID',\n 'QUARTER',\n 'QUOTE',\n 'RADIANS',\n 'RAND',\n 'RANDOM_BYTES',\n 'RANK',\n 'REGEXP',\n 'REGEXP_INSTR',\n 'REGEXP_LIKE',\n 'REGEXP_REPLACE',\n 'REGEXP_SUBSTR',\n 'RELEASE_ALL_LOCKS',\n 'RELEASE_LOCK',\n 'REPEAT',\n 'REPLACE',\n 'REVERSE',\n 'RIGHT',\n 'RLIKE',\n 'ROLES_GRAPHML',\n 'ROUND',\n 'ROW_COUNT',\n 'ROW_NUMBER',\n 'RPAD',\n 'RTRIM',\n 'SCHEMA',\n 'SEC_TO_TIME',\n 'SECOND',\n 'SESSION_USER',\n 'SHA1',\n 'SHA2',\n 'SIGN',\n 'SIN',\n 'SLEEP',\n 'SOUNDEX',\n 'SOUNDS LIKE',\n 'SOURCE_POS_WAIT',\n 'SPACE',\n 'SQRT',\n 'ST_Area',\n 'ST_AsBinary',\n 'ST_AsGeoJSON',\n 'ST_AsText',\n 'ST_Buffer',\n 'ST_Buffer_Strategy',\n 'ST_Centroid',\n 'ST_Collect',\n 'ST_Contains',\n 'ST_ConvexHull',\n 'ST_Crosses',\n 'ST_Difference',\n 'ST_Dimension',\n 'ST_Disjoint',\n 'ST_Distance',\n 'ST_Distance_Sphere',\n 'ST_EndPoint',\n 'ST_Envelope',\n 'ST_Equals',\n 'ST_ExteriorRing',\n 'ST_FrechetDistance',\n 'ST_GeoHash',\n 'ST_GeomCollFromText',\n 'ST_GeomCollFromWKB',\n 'ST_GeometryN',\n 'ST_GeometryType',\n 'ST_GeomFromGeoJSON',\n 'ST_GeomFromText',\n 'ST_GeomFromWKB',\n 'ST_HausdorffDistance',\n 'ST_InteriorRingN',\n 'ST_Intersection',\n 'ST_Intersects',\n 'ST_IsClosed',\n 'ST_IsEmpty',\n 'ST_IsSimple',\n 'ST_IsValid',\n 'ST_LatFromGeoHash',\n 'ST_Latitude',\n 'ST_Length',\n 'ST_LineFromText',\n 'ST_LineFromWKB',\n 'ST_LineInterpolatePoint',\n 'ST_LineInterpolatePoints',\n 'ST_LongFromGeoHash',\n 'ST_Longitude',\n 'ST_MakeEnvelope',\n 'ST_MLineFromText',\n 'ST_MLineFromWKB',\n 'ST_MPointFromText',\n 'ST_MPointFromWKB',\n 'ST_MPolyFromText',\n 'ST_MPolyFromWKB',\n 'ST_NumGeometries',\n 'ST_NumInteriorRing',\n 'ST_NumPoints',\n 'ST_Overlaps',\n 'ST_PointAtDistance',\n 'ST_PointFromGeoHash',\n 'ST_PointFromText',\n 'ST_PointFromWKB',\n 'ST_PointN',\n 'ST_PolyFromText',\n 'ST_PolyFromWKB',\n 'ST_Simplify',\n 'ST_SRID',\n 'ST_StartPoint',\n 'ST_SwapXY',\n 'ST_SymDifference',\n 'ST_Touches',\n 'ST_Transform',\n 'ST_Union',\n 'ST_Validate',\n 'ST_Within',\n 'ST_X',\n 'ST_Y',\n 'STATEMENT_DIGEST',\n 'STATEMENT_DIGEST_TEXT',\n 'STD',\n 'STDDEV',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'STR_TO_DATE',\n 'STRCMP',\n 'SUBDATE',\n 'SUBSTR',\n 'SUBSTRING',\n 'SUBSTRING_INDEX',\n 'SUBTIME',\n 'SUM',\n 'SYSDATE',\n 'SYSTEM_USER',\n 'TAN',\n 'TIME',\n 'TIME_FORMAT',\n 'TIME_TO_SEC',\n 'TIMEDIFF',\n 'TIMESTAMP',\n 'TIMESTAMPADD',\n 'TIMESTAMPDIFF',\n 'TO_BASE64',\n 'TO_DAYS',\n 'TO_SECONDS',\n 'TRIM',\n 'TRUNCATE',\n 'UCASE',\n 'UNCOMPRESS',\n 'UNCOMPRESSED_LENGTH',\n 'UNHEX',\n 'UNIX_TIMESTAMP',\n 'UpdateXML',\n 'UPPER',\n 'USER',\n 'UTC_DATE',\n 'UTC_TIME',\n 'UTC_TIMESTAMP',\n 'UUID',\n 'UUID_SHORT',\n 'UUID_TO_BIN',\n 'VALIDATE_PASSWORD_STRENGTH',\n 'VALUES',\n 'VAR_POP',\n 'VAR_SAMP',\n 'VARIANCE',\n 'VERSION',\n 'WAIT_FOR_EXECUTED_GTID_SET',\n 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS',\n 'WEEK',\n 'WEEKDAY',\n 'WEEKOFYEAR',\n 'WEIGHT_STRING',\n 'XOR',\n 'YEAR',\n 'YEARWEEK',\n];\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\n// https://dev.mysql.com/doc/refman/8.0/en/keywords.html\nconst reservedKeywords = [\n 'ACCESSIBLE',\n 'ACCOUNT',\n 'ACTION',\n 'ACTIVE',\n 'ADMIN',\n 'AFTER',\n 'AGAINST',\n 'AGGREGATE',\n 'ALGORITHM',\n 'ALL',\n 'ALTER',\n 'ALWAYS',\n 'ANALYSE',\n 'ANALYZE',\n 'ANY',\n 'ARRAY',\n 'AS',\n 'ASC',\n 'ASENSITIVE',\n 'AT',\n 'ATTRIBUTE',\n 'AUTHENTICATION',\n 'AUTOEXTEND_SIZE',\n 'AUTO_INCREMENT',\n 'AVG_ROW_LENGTH',\n 'BACKUP',\n 'BEFORE',\n 'BEGIN',\n 'BETWEEN',\n 'BIGINT',\n 'BIT',\n 'BLOB',\n 'BLOCK',\n 'BOOL',\n 'BOOLEAN',\n 'BOTH',\n 'BTREE',\n 'BUCKETS',\n 'BY',\n 'BYTE',\n 'CACHE',\n 'CASCADE',\n 'CASCADED',\n 'CATALOG_NAME',\n 'CHAIN',\n 'CHALLENGE_RESPONSE',\n 'CHANGE',\n 'CHANGED',\n 'CHANNEL',\n 'CHARACTER',\n 'CHARACTER SET',\n 'CHECK',\n 'CHECKSUM',\n 'CIPHER',\n 'CLASS_ORIGIN',\n 'CLIENT',\n 'CLOSE',\n 'CODE',\n 'COLLATE',\n 'COLUMN',\n 'COLUMNS',\n 'COLUMN_FORMAT',\n 'COLUMN_NAME',\n 'COMMENT',\n 'COMMITTED',\n 'COMPACT',\n 'COMPLETION',\n 'COMPONENT',\n 'COMPRESSED',\n 'COMPRESSION',\n 'CONCURRENT',\n 'CONDITION',\n 'CONNECTION',\n 'CONSISTENT',\n 'CONSTRAINT',\n 'CONSTRAINT_CATALOG',\n 'CONSTRAINT_NAME',\n 'CONSTRAINT_SCHEMA',\n 'CONTAINS',\n 'CONTEXT',\n 'CONTINUE',\n 'CPU',\n 'CREATE',\n 'CROSS',\n 'CUBE',\n 'CURRENT',\n 'CURSOR',\n 'CURSOR_NAME',\n 'DATA',\n 'DATABASES',\n 'DATAFILE',\n 'DATETIME',\n 'DAY_HOUR',\n 'DAY_MICROSECOND',\n 'DAY_MINUTE',\n 'DAY_SECOND',\n 'DEALLOCATE',\n 'DEC',\n 'DECIMAL',\n 'DECLARE',\n 'DEFAULT_AUTH',\n 'DEFINER',\n 'DEFINITION',\n 'DELAYED',\n 'DELAY_KEY_WRITE',\n 'DESC',\n 'DESCRIPTION',\n 'DES_KEY_FILE',\n 'DETERMINISTIC',\n 'DIAGNOSTICS',\n 'DIRECTORY',\n 'DISABLE',\n 'DISCARD',\n 'DISK',\n 'DISTINCT',\n 'DISTINCTROW',\n 'DOUBLE',\n 'DROP',\n 'DUAL',\n 'DUMPFILE',\n 'DUPLICATE',\n 'DYNAMIC',\n 'EACH',\n 'EMPTY',\n 'ENABLE',\n 'ENCLOSED',\n 'ENCRYPTION',\n 'ENDS',\n 'ENFORCED',\n 'ENGINE',\n 'ENGINES',\n 'ENGINE_ATTRIBUTE',\n 'ENUM',\n 'ERROR',\n 'ERRORS',\n 'ESCAPE',\n 'ESCAPED',\n 'EVENT',\n 'EVENTS',\n 'EVERY',\n 'EXCHANGE',\n 'EXCLUDE',\n 'EXISTS',\n 'EXIT',\n 'EXPANSION',\n 'EXPIRE',\n 'EXPORT',\n 'EXTENDED',\n 'EXTENT_SIZE',\n 'FACTOR',\n 'FAILED_LOGIN_ATTEMPTS',\n 'FALSE',\n 'FAST',\n 'FAULTS',\n 'FETCH',\n 'FIELDS',\n 'FILE',\n 'FILE_BLOCK_SIZE',\n 'FILTER',\n 'FINISH',\n 'FIRST',\n 'FIXED',\n 'FLOAT',\n 'FLOAT4',\n 'FLOAT8',\n 'FOLLOWING',\n 'FOLLOWS',\n 'FOR',\n 'FORCE',\n 'FOREIGN',\n 'FOUND',\n 'FULL',\n 'FULLTEXT',\n 'FUNCTION',\n 'GENERAL',\n 'GENERATED',\n 'GEOMCOLLECTION',\n 'GEOMETRY',\n 'GEOMETRYCOLLECTION',\n 'GET',\n 'GET_MASTER_PUBLIC_KEY',\n 'GET_SOURCE_PUBLIC_KEY',\n 'GLOBAL',\n '@@GLOBAL',\n 'GRANTS',\n 'GROUP',\n 'GROUPS',\n 'GROUP_REPLICATION',\n 'GTID_ONLY',\n 'HASH',\n 'HIGH_PRIORITY',\n 'HISTOGRAM',\n 'HISTORY',\n 'HOST',\n 'HOSTS',\n 'HOUR_MICROSECOND',\n 'HOUR_MINUTE',\n 'HOUR_SECOND',\n 'IDENTIFIED',\n 'IGNORE',\n 'IGNORE_SERVER_IDS',\n 'IMPORT',\n 'INACTIVE',\n 'INDEX',\n 'INDEXES',\n 'INFILE',\n 'INITIAL',\n 'INITIAL_SIZE',\n 'INITIATE',\n 'INNER',\n 'INOUT',\n 'INSENSITIVE',\n 'INSERT_METHOD',\n 'INSTALL',\n 'INSTANCE',\n 'INT',\n 'INT1',\n 'INT2',\n 'INT3',\n 'INT4',\n 'INT8',\n 'INTEGER',\n 'INTO',\n 'INVISIBLE',\n 'INVOKER',\n 'IO',\n 'IO_AFTER_GTIDS',\n 'IO_BEFORE_GTIDS',\n 'IO_THREAD',\n 'IPC',\n 'ISOLATION',\n 'ISSUER',\n 'ITERATE',\n 'JSON',\n 'KEY',\n 'KEYRING',\n 'KEYS',\n 'KEY_BLOCK_SIZE',\n 'LANGUAGE',\n 'LAST',\n 'LATERAL',\n 'LEADING',\n 'LEAVE',\n 'LEAVES',\n 'LESS',\n 'LEVEL',\n 'LINEAR',\n 'LINES',\n 'LINESTRING',\n 'LIST',\n 'LOAD',\n 'LOCAL',\n 'LOCK',\n 'LOCKED',\n 'LOCKS',\n 'LOGFILE',\n 'LOGS',\n 'LONG',\n 'LONGBLOB',\n 'LONGTEXT',\n 'LOOP',\n 'LOW_PRIORITY',\n 'MASTER',\n 'MASTER_AUTO_POSITION',\n 'MASTER_BIND',\n 'MASTER_COMPRESSION_ALGORITHMS',\n 'MASTER_CONNECT_RETRY',\n 'MASTER_DELAY',\n 'MASTER_HEARTBEAT_PERIOD',\n 'MASTER_HOST',\n 'MASTER_LOG_FILE',\n 'MASTER_LOG_POS',\n 'MASTER_PASSWORD',\n 'MASTER_PORT',\n 'MASTER_PUBLIC_KEY_PATH',\n 'MASTER_RETRY_COUNT',\n 'MASTER_SERVER_ID',\n 'MASTER_SSL',\n 'MASTER_SSL_CA',\n 'MASTER_SSL_CAPATH',\n 'MASTER_SSL_CERT',\n 'MASTER_SSL_CIPHER',\n 'MASTER_SSL_CRL',\n 'MASTER_SSL_CRLPATH',\n 'MASTER_SSL_KEY',\n 'MASTER_SSL_VERIFY_SERVER_CERT',\n 'MASTER_TLS_CIPHERSUITES',\n 'MASTER_TLS_VERSION',\n 'MASTER_USER',\n 'MASTER_ZSTD_COMPRESSION_LEVEL',\n 'MAXVALUE',\n 'MAX_CONNECTIONS_PER_HOUR',\n 'MAX_QUERIES_PER_HOUR',\n 'MAX_ROWS',\n 'MAX_SIZE',\n 'MAX_UPDATES_PER_HOUR',\n 'MAX_USER_CONNECTIONS',\n 'MEDIUM',\n 'MEDIUMBLOB',\n 'MEDIUMINT',\n 'MEDIUMTEXT',\n 'MEMBER',\n 'MEMORY',\n 'MERGE',\n 'MESSAGE_TEXT',\n 'MIDDLEINT',\n 'MIGRATE',\n 'MINUTE_MICROSECOND',\n 'MINUTE_SECOND',\n 'MIN_ROWS',\n 'MODE',\n 'MODIFIES',\n 'MODIFY',\n 'MULTILINESTRING',\n 'MULTIPOINT',\n 'MULTIPOLYGON',\n 'MUTEX',\n 'MYSQL_ERRNO',\n 'NAME',\n 'NAMES',\n 'NATIONAL',\n 'NATURAL',\n 'NCHAR',\n 'NDB',\n 'NDBCLUSTER',\n 'NESTED',\n 'NETWORK_NAMESPACE',\n 'NEVER',\n 'NEW',\n 'NEXT',\n 'NO',\n 'NODEGROUP',\n 'NONE',\n 'NOWAIT',\n 'NO_WAIT',\n 'NO_WRITE_TO_BINLOG',\n 'NULL',\n 'NULLS',\n 'NUMBER',\n 'NUMERIC',\n 'NVARCHAR',\n 'OF',\n 'OFF',\n 'OFFSET',\n 'OJ',\n 'OLD',\n 'ON DELETE',\n 'ON UPDATE',\n 'ONE',\n 'ONLY',\n 'OPEN',\n 'OPTIMIZE',\n 'OPTIMIZER_COSTS',\n 'OPTION',\n 'OPTIONAL',\n 'OPTIONALLY',\n 'OPTIONS',\n 'ORDER',\n 'ORDINALITY',\n 'ORGANIZATION',\n 'OTHERS',\n 'OUT',\n 'OUTER',\n 'OUTFILE',\n 'OVER',\n 'OWNER',\n 'PACK_KEYS',\n 'PAGE',\n 'PARSER',\n 'PARSE_GCOL_EXPR',\n 'PARTIAL',\n 'PARTITION',\n 'PARTITIONING',\n 'PARTITIONS',\n 'PASSWORD',\n 'PASSWORD_LOCK_TIME',\n 'PATH',\n 'PERSIST',\n '@@PERSIST',\n 'PERSIST_ONLY',\n '@@PERSIST_ONLY',\n 'PHASE',\n 'PLUGIN',\n 'PLUGINS',\n 'PLUGIN_DIR',\n 'POINT',\n 'POLYGON',\n 'PORT',\n 'PRECEDES',\n 'PRECEDING',\n 'PRECISION',\n 'PRESERVE',\n 'PREV',\n 'PRIMARY',\n 'PRIVILEGES',\n 'PRIVILEGE_CHECKS_USER',\n 'PROCEDURE',\n 'PROCESS',\n 'PROCESSLIST',\n 'PROFILE',\n 'PROFILES',\n 'PROXY',\n 'PURGE',\n 'QUERY',\n 'QUICK',\n 'RANDOM',\n 'RANGE',\n 'READ',\n 'READS',\n 'READ_ONLY',\n 'READ_WRITE',\n 'REAL',\n 'REBUILD',\n 'RECOVER',\n 'RECURSIVE',\n 'REDOFILE',\n 'REDO_BUFFER_SIZE',\n 'REDUNDANT',\n 'REFERENCE',\n 'REFERENCES',\n 'REGISTRATION',\n 'RELAY',\n 'RELAYLOG',\n 'RELAY_LOG_FILE',\n 'RELAY_LOG_POS',\n 'RELAY_THREAD',\n 'RELEASE',\n 'RELOAD',\n 'REMOTE',\n 'REMOVE',\n 'RENAME',\n 'REORGANIZE',\n 'REPAIR',\n 'REPEATABLE',\n 'REPLICA',\n 'REPLICAS',\n 'REPLICATE_DO_DB',\n 'REPLICATE_DO_TABLE',\n 'REPLICATE_IGNORE_DB',\n 'REPLICATE_IGNORE_TABLE',\n 'REPLICATE_REWRITE_DB',\n 'REPLICATE_WILD_DO_TABLE',\n 'REPLICATE_WILD_IGNORE_TABLE',\n 'REPLICATION',\n 'REQUIRE',\n 'REQUIRE_ROW_FORMAT',\n 'RESIGNAL',\n 'RESOURCE',\n 'RESPECT',\n 'RESTORE',\n 'RESTRICT',\n 'RESUME',\n 'RETAIN',\n 'RETURN',\n 'RETURNED_SQLSTATE',\n 'RETURNING',\n 'RETURNS',\n 'REUSE',\n 'ROLE',\n 'ROLLUP',\n 'ROTATE',\n 'ROUTINE',\n 'ROW',\n 'ROWS',\n 'ROW_FORMAT',\n 'RTREE',\n 'SCHEDULE',\n 'SCHEMAS',\n 'SCHEMA_NAME',\n 'SECONDARY',\n 'SECONDARY_ENGINE',\n 'SECONDARY_ENGINE_ATTRIBUTE',\n 'SECONDARY_LOAD',\n 'SECONDARY_UNLOAD',\n 'SECOND_MICROSECOND',\n 'SECURITY',\n 'SENSITIVE',\n 'SEPARATOR',\n 'SERIAL',\n 'SERIALIZABLE',\n 'SERVER',\n 'SESSION',\n '@@SESSION',\n 'SHARE',\n 'SIGNAL',\n 'SIGNED',\n 'SIMPLE',\n 'SKIP',\n 'SLAVE',\n 'SLOW',\n 'SMALLINT',\n 'SNAPSHOT',\n 'SOCKET',\n 'SOME',\n 'SONAME',\n 'SOUNDS',\n 'SOURCE',\n 'SOURCE_AUTO_POSITION',\n 'SOURCE_BIND',\n 'SOURCE_COMPRESSION_ALGORITHMS',\n 'SOURCE_CONNECT_RETRY',\n 'SOURCE_DELAY',\n 'SOURCE_HEARTBEAT_PERIOD',\n 'SOURCE_HOST',\n 'SOURCE_LOG_FILE',\n 'SOURCE_LOG_POS',\n 'SOURCE_PASSWORD',\n 'SOURCE_PORT',\n 'SOURCE_PUBLIC_KEY_PATH',\n 'SOURCE_RETRY_COUNT',\n 'SOURCE_SSL',\n 'SOURCE_SSL_CA',\n 'SOURCE_SSL_CAPATH',\n 'SOURCE_SSL_CERT',\n 'SOURCE_SSL_CIPHER',\n 'SOURCE_SSL_CRL',\n 'SOURCE_SSL_CRLPATH',\n 'SOURCE_SSL_KEY',\n 'SOURCE_SSL_VERIFY_SERVER_CERT',\n 'SOURCE_TLS_CIPHERSUITES',\n 'SOURCE_TLS_VERSION',\n 'SOURCE_USER',\n 'SOURCE_ZSTD_COMPRESSION_LEVEL',\n 'SPATIAL',\n 'SPECIFIC',\n 'SQL',\n 'SQLEXCEPTION',\n 'SQLSTATE',\n 'SQLWARNING',\n 'SQL_AFTER_GTIDS',\n 'SQL_AFTER_MTS_GAPS',\n 'SQL_BEFORE_GTIDS',\n 'SQL_BIG_RESULT',\n 'SQL_BUFFER_RESULT',\n 'SQL_CACHE',\n 'SQL_CALC_FOUND_ROWS',\n 'SQL_NO_CACHE',\n 'SQL_SMALL_RESULT',\n 'SQL_THREAD',\n 'SQL_TSI_DAY',\n 'SQL_TSI_HOUR',\n 'SQL_TSI_MINUTE',\n 'SQL_TSI_MONTH',\n 'SQL_TSI_QUARTER',\n 'SQL_TSI_SECOND',\n 'SQL_TSI_WEEK',\n 'SQL_TSI_YEAR',\n 'SRID',\n 'SSL',\n 'STACKED',\n 'START',\n 'STARTING',\n 'STARTS',\n 'STATS_AUTO_RECALC',\n 'STATS_PERSISTENT',\n 'STATS_SAMPLE_PAGES',\n 'STATUS',\n 'STOP',\n 'STORAGE',\n 'STORED',\n 'STREAM',\n 'STRING',\n 'SUBCLASS_ORIGIN',\n 'SUBJECT',\n 'SUBPARTITION',\n 'SUBPARTITIONS',\n 'SUPER',\n 'SUSPEND',\n 'SWAPS',\n 'SWITCHES',\n 'SYSTEM',\n 'TABLES',\n 'TABLESPACE',\n 'TABLE_CHECKSUM',\n 'TABLE_NAME',\n 'TEMPORARY',\n 'TEMPTABLE',\n 'TERMINATED',\n 'TEXT',\n 'THAN',\n 'THEN',\n 'THREAD_PRIORITY',\n 'TIES',\n 'TINYBLOB',\n 'TINYINT',\n 'TINYTEXT',\n 'TLS',\n 'TO',\n 'TRAILING',\n 'TRANSACTION',\n 'TRIGGER',\n 'TRIGGERS',\n 'TRUE',\n 'TYPE',\n 'TYPES',\n 'UNBOUNDED',\n 'UNCOMMITTED',\n 'UNDEFINED',\n 'UNDO',\n 'UNDOFILE',\n 'UNDO_BUFFER_SIZE',\n 'UNICODE',\n 'UNINSTALL',\n 'UNIQUE',\n 'UNKNOWN',\n 'UNLOCK',\n 'UNREGISTER',\n 'UNSIGNED',\n 'UNTIL',\n 'UPGRADE',\n 'USAGE',\n 'USER_RESOURCES',\n 'USE_FRM',\n 'VALIDATION',\n 'VALUE',\n 'VARBINARY',\n 'VARCHAR',\n 'VARCHARACTER',\n 'VARIABLES',\n 'VARYING',\n 'VCPU',\n 'VIEW',\n 'VIRTUAL',\n 'VISIBLE',\n 'WAIT',\n 'WARNINGS',\n 'WHILE',\n 'WINDOW',\n 'WITHOUT',\n 'WORK',\n 'WRAPPER',\n 'WRITE',\n 'X509',\n 'XID',\n 'XML',\n 'YEAR_MONTH',\n 'ZEROFILL',\n 'ZONE',\n];\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// https://dev.mysql.com/doc/refman/8.0/en/sql-statements.html\nconst reservedCommands = [\n 'ALTER DATABASE',\n 'ALTER EVENT',\n 'ALTER FUNCTION',\n 'ALTER INSTANCE',\n 'ALTER LOGFILE GROUP',\n 'ALTER PROCEDURE',\n 'ALTER RESOURCE GROUP',\n 'ALTER SERVER',\n 'ALTER TABLE',\n 'ALTER TABLESPACE',\n 'ALTER USER',\n 'ALTER VIEW',\n 'ANALYZE TABLE',\n 'BINLOG',\n 'CACHE INDEX',\n 'CALL',\n 'CHANGE MASTER TO',\n 'CHANGE REPLICATION FILTER',\n 'CHANGE REPLICATION SOURCE TO',\n 'CHECK TABLE',\n 'CHECKSUM TABLE',\n 'CLONE',\n 'COMMIT',\n 'CREATE DATABASE',\n 'CREATE EVENT',\n 'CREATE FUNCTION',\n 'CREATE FUNCTION',\n 'CREATE INDEX',\n 'CREATE LOGFILE GROUP',\n 'CREATE PROCEDURE',\n 'CREATE RESOURCE GROUP',\n 'CREATE ROLE',\n 'CREATE SERVER',\n 'CREATE SPATIAL REFERENCE SYSTEM',\n 'CREATE TABLE',\n 'CREATE TABLESPACE',\n 'CREATE TRIGGER',\n 'CREATE USER',\n 'CREATE VIEW',\n 'DEALLOCATE PREPARE',\n 'DELETE',\n 'DESCRIBE',\n 'DO',\n 'DROP DATABASE',\n 'DROP EVENT',\n 'DROP FUNCTION',\n 'DROP FUNCTION',\n 'DROP INDEX',\n 'DROP LOGFILE GROUP',\n 'DROP PROCEDURE',\n 'DROP RESOURCE GROUP',\n 'DROP ROLE',\n 'DROP SERVER',\n 'DROP SPATIAL REFERENCE SYSTEM',\n 'DROP TABLE',\n 'DROP TABLESPACE',\n 'DROP TRIGGER',\n 'DROP USER',\n 'DROP VIEW',\n 'EXECUTE',\n 'EXPLAIN',\n 'FLUSH',\n 'GRANT',\n 'HANDLER',\n 'HELP',\n 'IMPORT TABLE',\n 'INSERT',\n 'INSTALL COMPONENT',\n 'INSTALL PLUGIN',\n 'KILL',\n 'LOAD DATA',\n 'LOAD INDEX INTO CACHE',\n 'LOAD XML',\n 'LOCK INSTANCE FOR BACKUP',\n 'LOCK TABLES',\n 'MASTER_POS_WAIT',\n 'OPTIMIZE TABLE',\n 'PREPARE',\n 'PURGE BINARY LOGS',\n 'RELEASE SAVEPOINT',\n 'RENAME TABLE',\n 'RENAME USER',\n 'REPAIR TABLE',\n 'REPLACE',\n 'RESET',\n 'RESET MASTER',\n 'RESET PERSIST',\n 'RESET REPLICA',\n 'RESET SLAVE',\n 'RESTART',\n 'REVOKE',\n 'ROLLBACK',\n 'ROLLBACK TO SAVEPOINT',\n 'SAVEPOINT',\n 'SELECT',\n 'SET',\n 'SET CHARACTER SET',\n 'SET DEFAULT ROLE',\n 'SET NAMES',\n 'SET PASSWORD',\n 'SET RESOURCE GROUP',\n 'SET ROLE',\n 'SET TRANSACTION',\n 'SHOW',\n 'SHOW BINARY LOGS',\n 'SHOW BINLOG EVENTS',\n 'SHOW CHARACTER SET',\n 'SHOW COLLATION',\n 'SHOW COLUMNS',\n 'SHOW CREATE DATABASE',\n 'SHOW CREATE EVENT',\n 'SHOW CREATE FUNCTION',\n 'SHOW CREATE PROCEDURE',\n 'SHOW CREATE TABLE',\n 'SHOW CREATE TRIGGER',\n 'SHOW CREATE USER',\n 'SHOW CREATE VIEW',\n 'SHOW DATABASES',\n 'SHOW ENGINE',\n 'SHOW ENGINES',\n 'SHOW ERRORS',\n 'SHOW EVENTS',\n 'SHOW FUNCTION CODE',\n 'SHOW FUNCTION STATUS',\n 'SHOW GRANTS',\n 'SHOW INDEX',\n 'SHOW MASTER STATUS',\n 'SHOW OPEN TABLES',\n 'SHOW PLUGINS',\n 'SHOW PRIVILEGES',\n 'SHOW PROCEDURE CODE',\n 'SHOW PROCEDURE STATUS',\n 'SHOW PROCESSLIST',\n 'SHOW PROFILE',\n 'SHOW PROFILES',\n 'SHOW RELAYLOG EVENTS',\n 'SHOW REPLICA STATUS',\n 'SHOW REPLICAS',\n 'SHOW SLAVE',\n 'SHOW SLAVE HOSTS',\n 'SHOW STATUS',\n 'SHOW TABLE STATUS',\n 'SHOW TABLES',\n 'SHOW TRIGGERS',\n 'SHOW VARIABLES',\n 'SHOW WARNINGS',\n 'SHUTDOWN',\n 'SOURCE_POS_WAIT',\n 'START GROUP_REPLICATION',\n 'START REPLICA',\n 'START SLAVE',\n 'START TRANSACTION',\n 'STOP GROUP_REPLICATION',\n 'STOP REPLICA',\n 'STOP SLAVE',\n 'TABLE',\n 'TRUNCATE TABLE',\n 'UNINSTALL COMPONENT',\n 'UNINSTALL PLUGIN',\n 'UNLOCK INSTANCE',\n 'UNLOCK TABLES',\n 'UPDATE',\n 'USE',\n 'VALUES',\n 'WITH',\n 'XA',\n // flow control\n // 'IF',\n 'ITERATE',\n 'LEAVE',\n 'LOOP',\n 'REPEAT',\n 'RETURN',\n 'WHILE',\n // other\n 'ADD',\n 'ALTER COLUMN',\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'INSERT INTO',\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'WHERE',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n // non-standard joins\n 'STRAIGHT_JOIN',\n 'NATURAL LEFT JOIN',\n 'NATURAL LEFT OUTER JOIN',\n 'NATURAL RIGHT JOIN',\n 'NATURAL RIGHT OUTER JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE', 'ELSEIF'];\n\n// https://dev.mysql.com/doc/refman/8.0/en/\nexport default class MySqlFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR', 'XOR'];\n static reservedKeywords = dedupe([...reservedKeywords, ...reservedFunctions]);\n static stringTypes: StringPatternType[] = ['``', \"''\", '\"\"'];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = [];\n static lineCommentTypes = ['--', '#'];\n static specialWordChars = { prefix: '@:' };\n static operators = [':=', '<<', '>>', '<=>', '&&', '||', '->', '->>'];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: MySqlFormatter.reservedCommands,\n reservedBinaryCommands: MySqlFormatter.reservedBinaryCommands,\n reservedDependentClauses: MySqlFormatter.reservedDependentClauses,\n reservedJoinConditions: MySqlFormatter.reservedJoinConditions,\n reservedLogicalOperators: MySqlFormatter.reservedLogicalOperators,\n reservedKeywords: MySqlFormatter.reservedKeywords,\n stringTypes: MySqlFormatter.stringTypes,\n blockStart: MySqlFormatter.blockStart,\n blockEnd: MySqlFormatter.blockEnd,\n indexedPlaceholderTypes: MySqlFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: MySqlFormatter.namedPlaceholderTypes,\n lineCommentTypes: MySqlFormatter.lineCommentTypes,\n specialWordChars: MySqlFormatter.specialWordChars,\n operators: MySqlFormatter.operators,\n });\n }\n\n tokenOverride(token: Token) {\n // [SET] ( ...\n if (isToken.SET(token) && this.tokenLookAhead().value === '(') {\n // This is SET datatype, not SET statement\n return { type: TokenType.RESERVED_KEYWORD, value: token.value };\n }\n\n return token;\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n// TODO: split this into object with function categories\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\n// https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/functions.html\nconst reservedFunctions = [\n 'ABORT',\n 'ABS',\n 'ACOS',\n 'ADVISOR',\n 'ARRAY_AGG',\n 'ARRAY_AGG',\n 'ARRAY_APPEND',\n 'ARRAY_AVG',\n 'ARRAY_BINARY_SEARCH',\n 'ARRAY_CONCAT',\n 'ARRAY_CONTAINS',\n 'ARRAY_COUNT',\n 'ARRAY_DISTINCT',\n 'ARRAY_EXCEPT',\n 'ARRAY_FLATTEN',\n 'ARRAY_IFNULL',\n 'ARRAY_INSERT',\n 'ARRAY_INTERSECT',\n 'ARRAY_LENGTH',\n 'ARRAY_MAX',\n 'ARRAY_MIN',\n 'ARRAY_MOVE',\n 'ARRAY_POSITION',\n 'ARRAY_PREPEND',\n 'ARRAY_PUT',\n 'ARRAY_RANGE',\n 'ARRAY_REMOVE',\n 'ARRAY_REPEAT',\n 'ARRAY_REPLACE',\n 'ARRAY_REVERSE',\n 'ARRAY_SORT',\n 'ARRAY_STAR',\n 'ARRAY_SUM',\n 'ARRAY_SYMDIFF',\n 'ARRAY_SYMDIFF1',\n 'ARRAY_SYMDIFFN',\n 'ARRAY_UNION',\n 'ASIN',\n 'ATAN',\n 'ATAN2',\n 'AVG',\n 'BASE64',\n 'BASE64_DECODE',\n 'BASE64_ENCODE',\n 'BITAND ',\n 'BITCLEAR ',\n 'BITNOT ',\n 'BITOR ',\n 'BITSET ',\n 'BITSHIFT ',\n 'BITTEST ',\n 'BITXOR ',\n 'CEIL',\n 'CLOCK_LOCAL',\n 'CLOCK_MILLIS',\n 'CLOCK_STR',\n 'CLOCK_TZ',\n 'CLOCK_UTC',\n 'COALESCE',\n 'CONCAT',\n 'CONCAT2',\n 'CONTAINS',\n 'CONTAINS_TOKEN',\n 'CONTAINS_TOKEN_LIKE',\n 'CONTAINS_TOKEN_REGEXP',\n 'COS',\n 'COUNT',\n 'COUNT',\n 'COUNTN',\n 'CUME_DIST',\n 'CURL',\n 'DATE_ADD_MILLIS',\n 'DATE_ADD_STR',\n 'DATE_DIFF_MILLIS',\n 'DATE_DIFF_STR',\n 'DATE_FORMAT_STR',\n 'DATE_PART_MILLIS',\n 'DATE_PART_STR',\n 'DATE_RANGE_MILLIS',\n 'DATE_RANGE_STR',\n 'DATE_TRUNC_MILLIS',\n 'DATE_TRUNC_STR',\n 'DECODE',\n 'DECODE_JSON',\n 'DEGREES',\n 'DENSE_RANK',\n 'DURATION_TO_STR',\n // 'E',\n 'ENCODED_SIZE',\n 'ENCODE_JSON',\n 'EXP',\n 'FIRST_VALUE',\n 'FLOOR',\n 'GREATEST',\n 'HAS_TOKEN',\n 'IFINF',\n 'IFMISSING',\n 'IFMISSINGORNULL',\n 'IFNAN',\n 'IFNANORINF',\n 'IFNULL',\n 'INITCAP',\n 'ISARRAY',\n 'ISATOM',\n 'ISBITSET',\n 'ISBOOLEAN',\n 'ISNUMBER',\n 'ISOBJECT',\n 'ISSTRING',\n 'LAG',\n 'LAST_VALUE',\n 'LEAD',\n 'LEAST',\n 'LENGTH',\n 'LN',\n 'LOG',\n 'LOWER',\n 'LTRIM',\n 'MAX',\n 'MEAN',\n 'MEDIAN',\n 'META',\n 'MILLIS',\n 'MILLIS_TO_LOCAL',\n 'MILLIS_TO_STR',\n 'MILLIS_TO_TZ',\n 'MILLIS_TO_UTC',\n 'MILLIS_TO_ZONE_NAME',\n 'MIN',\n 'MISSINGIF',\n 'NANIF',\n 'NEGINFIF',\n 'NOW_LOCAL',\n 'NOW_MILLIS',\n 'NOW_STR',\n 'NOW_TZ',\n 'NOW_UTC',\n 'NTH_VALUE',\n 'NTILE',\n 'NULLIF',\n 'NVL',\n 'NVL2',\n 'OBJECT_ADD',\n 'OBJECT_CONCAT',\n 'OBJECT_INNER_PAIRS',\n 'OBJECT_INNER_VALUES',\n 'OBJECT_LENGTH',\n 'OBJECT_NAMES',\n 'OBJECT_PAIRS',\n 'OBJECT_PUT',\n 'OBJECT_REMOVE',\n 'OBJECT_RENAME',\n 'OBJECT_REPLACE',\n 'OBJECT_UNWRAP',\n 'OBJECT_VALUES',\n 'PAIRS',\n 'PERCENT_RANK',\n 'PI',\n 'POLY_LENGTH',\n 'POSINFIF',\n 'POSITION',\n 'POWER',\n 'RADIANS',\n 'RANDOM',\n 'RANK',\n 'RATIO_TO_REPORT',\n 'REGEXP_CONTAINS',\n 'REGEXP_LIKE',\n 'REGEXP_MATCHES',\n 'REGEXP_POSITION',\n 'REGEXP_REPLACE',\n 'REGEXP_SPLIT',\n 'REGEX_CONTAINS',\n 'REGEX_LIKE',\n 'REGEX_MATCHES',\n 'REGEX_POSITION',\n 'REGEX_REPLACE',\n 'REGEX_SPLIT',\n 'REPEAT',\n 'REPLACE',\n 'REVERSE',\n 'ROUND',\n 'ROW_NUMBER',\n 'RTRIM',\n 'SEARCH',\n 'SEARCH_META',\n 'SEARCH_SCORE',\n 'SIGN',\n 'SIN',\n 'SPLIT',\n 'SQRT',\n 'STDDEV',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'STR_TO_DURATION',\n 'STR_TO_MILLIS',\n 'STR_TO_TZ',\n 'STR_TO_UTC',\n 'STR_TO_ZONE_NAME',\n 'SUBSTR',\n 'SUFFIXES',\n 'SUM',\n 'TAN',\n 'TITLE',\n 'TOARRAY',\n 'TOATOM',\n 'TOBOOLEAN',\n 'TOKENS',\n 'TOKENS',\n 'TONUMBER',\n 'TOOBJECT',\n 'TOSTRING',\n 'TRIM',\n 'TRUNC',\n // 'TYPE', // disabled\n 'UPPER',\n 'UUID',\n 'VARIANCE',\n 'VARIANCE_POP',\n 'VARIANCE_SAMP',\n 'VAR_POP',\n 'VAR_SAMP',\n 'WEEKDAY_MILLIS',\n 'WEEKDAY_STR',\n];\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\n// https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/reservedwords.html\nconst reservedKeywords = [\n 'ALL',\n 'ALTER',\n 'ANALYZE',\n 'ANY',\n 'ARRAY',\n 'AS',\n 'ASC',\n 'AT',\n 'BEGIN',\n 'BETWEEN',\n 'BINARY',\n 'BOOLEAN',\n 'BREAK',\n 'BUCKET',\n 'BUILD',\n 'BY',\n 'CALL',\n 'CAST',\n 'CHAR', // verify\n 'CLUSTER',\n 'COLLATE',\n 'COLLECTION',\n 'COMMIT',\n 'COMMITTED',\n 'CONNECT',\n 'CONTINUE',\n 'CORRELATE',\n 'CORRELATED',\n 'COVER',\n 'CREATE',\n 'CURRENT',\n 'DATABASE',\n 'DATASET',\n 'DATASTORE',\n 'DECLARE',\n 'DECREMENT',\n 'DERIVED',\n 'DESC',\n 'DESCRIBE',\n 'DISTINCT',\n 'DO',\n 'DROP',\n 'EACH',\n 'ELEMENT',\n 'EVERY',\n 'EXCLUDE',\n 'EXISTS',\n 'FALSE',\n 'FETCH',\n 'FILTER',\n 'FIRST',\n 'FLATTEN',\n 'FLUSH',\n 'FOLLOWING',\n 'FOR',\n 'FORCE',\n 'FTS',\n 'FUNCTION',\n 'GOLANG',\n 'GROUP',\n 'GROUPS',\n 'GSI',\n 'HASH',\n 'IF',\n 'IGNORE',\n 'ILIKE',\n 'IN',\n 'INCLUDE',\n 'INCREMENT',\n 'INDEX',\n 'INLINE',\n 'INNER',\n 'INTO',\n 'IS',\n 'ISOLATION',\n 'JAVASCRIPT',\n 'KEY',\n 'KEYS',\n 'KEYSPACE',\n 'KNOWN',\n 'LANGUAGE',\n 'LAST',\n 'LEFT',\n 'LETTING',\n 'LEVEL',\n 'LIKE',\n 'LSM',\n 'MAP',\n 'MAPPING',\n 'MATCHED',\n 'MATERIALIZED',\n 'MISSING',\n 'NAMESPACE',\n 'NL',\n 'NO',\n 'NOT',\n 'NULL',\n 'NULLS',\n 'NUMBER',\n 'OBJECT',\n 'OFFSET',\n 'OPTION',\n 'OPTIONS',\n 'ORDER',\n 'OTHERS',\n 'OUTER',\n 'OVER',\n 'PARSE',\n 'PARTITION',\n 'PASSWORD',\n 'PATH',\n 'POOL',\n 'PRECEDING',\n 'PRIMARY',\n 'PRIVATE',\n 'PRIVILEGE',\n 'PROBE',\n 'PROCEDURE',\n 'PUBLIC',\n 'RANGE',\n 'RAW',\n 'REALM',\n 'REDUCE',\n 'RENAME',\n 'RESPECT',\n 'RETURN',\n 'RIGHT',\n 'ROLE',\n 'ROLLBACK',\n 'ROW',\n 'ROWS',\n 'SATISFIES',\n 'SCHEMA',\n 'SCOPE',\n 'SELF',\n 'SEMI',\n 'SOME',\n 'START',\n 'STATISTICS',\n 'STRING',\n 'SYSTEM',\n 'THEN',\n 'TIES',\n 'TO',\n 'TRAN',\n 'TRANSACTION',\n 'TRIGGER',\n 'TRUE',\n 'TRUNCATE',\n 'UNBOUNDED',\n 'UNDER',\n 'UNIQUE',\n 'UNKNOWN',\n 'UNSET',\n 'USE',\n 'USER',\n 'VALIDATE',\n 'VALUE',\n 'VALUED',\n 'VIA',\n 'VIEW',\n 'WHILE',\n 'WINDOW',\n 'WITHIN',\n 'WORK',\n];\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/reservedwords.html\nconst reservedCommands = [\n 'ADVISE',\n 'ALTER INDEX',\n 'BEGIN TRANSACTION',\n 'BUILD INDEX',\n 'COMMIT TRANSACTION',\n 'CREATE COLLECTION',\n 'CREATE FUNCTION',\n 'CREATE INDEX',\n 'CREATE PRIMARY INDEX',\n 'CREATE SCOPE',\n 'CREATE TABLE', // verify\n 'DELETE',\n 'DROP COLLECTION',\n 'DROP FUNCTION',\n 'DROP INDEX',\n 'DROP PRIMARY INDEX',\n 'DROP SCOPE',\n 'EXECUTE',\n 'EXECUTE FUNCTION',\n 'EXPLAIN',\n 'GRANT',\n 'INFER',\n 'INSERT',\n 'MERGE',\n 'PREPARE',\n 'RETURNING',\n 'REVOKE',\n 'ROLLBACK TRANSACTION',\n 'SAVEPOINT',\n 'SELECT',\n 'SET TRANSACTION',\n 'UPDATE',\n 'UPDATE STATISTICS',\n 'UPSERT',\n // other\n 'DROP TABLE', // verify,\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'INSERT INTO',\n 'LET',\n 'LIMIT',\n 'OFFSET',\n 'NEST',\n 'ORDER BY',\n 'SET CURRENT SCHEMA',\n 'SET SCHEMA',\n 'SET',\n 'SHOW',\n 'UNNEST',\n 'USE KEYS',\n 'VALUES',\n 'WHERE',\n 'WITH',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n 'MINUS',\n 'MINUS ALL',\n 'MINUS DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\n// For reference: http://docs.couchbase.com.s3-website-us-west-1.amazonaws.com/server/6.0/n1ql/n1ql-language-reference/index.html\nexport default class N1qlFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR', 'XOR'];\n static reservedKeywords = dedupe([...reservedKeywords, ...reservedFunctions]);\n static stringTypes: StringPatternType[] = [`\"\"`, \"''\", '``'];\n static blockStart = ['(', '[', '{', 'CASE'];\n static blockEnd = [')', ']', '}', 'END'];\n static namedPlaceholderTypes = ['$'];\n static lineCommentTypes = ['#', '--'];\n static operators = ['=='];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: N1qlFormatter.reservedCommands,\n reservedBinaryCommands: N1qlFormatter.reservedBinaryCommands,\n reservedDependentClauses: N1qlFormatter.reservedDependentClauses,\n reservedJoinConditions: N1qlFormatter.reservedJoinConditions,\n reservedLogicalOperators: N1qlFormatter.reservedLogicalOperators,\n reservedKeywords: N1qlFormatter.reservedKeywords,\n stringTypes: N1qlFormatter.stringTypes,\n blockStart: N1qlFormatter.blockStart,\n blockEnd: N1qlFormatter.blockEnd,\n namedPlaceholderTypes: N1qlFormatter.namedPlaceholderTypes,\n lineCommentTypes: N1qlFormatter.lineCommentTypes,\n operators: N1qlFormatter.operators,\n });\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport { isToken, Token, TokenType } from '../core/token'; // convert to partial type import in TS 4.5\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\nconst reservedKeywords = [\n // 'A',\n 'ACCESSIBLE',\n 'AGENT',\n 'AGGREGATE',\n 'ALL',\n 'ALTER',\n 'ANY',\n 'ARRAY',\n 'AS',\n 'ASC',\n 'AT',\n 'ATTRIBUTE',\n 'AUTHID',\n 'AVG',\n 'BETWEEN',\n 'BFILE_BASE',\n 'BINARY',\n 'BINARY_INTEGER',\n 'BLOB_BASE',\n 'BLOCK',\n 'BODY',\n 'BOOLEAN',\n 'BOTH',\n 'BOUND',\n 'BREADTH',\n 'BULK',\n 'BY',\n 'BYTE',\n // 'C',\n 'CALL',\n 'CALLING',\n 'CASCADE',\n 'CAST',\n 'CHAR',\n 'CHARACTER',\n 'CHARSET',\n 'CHARSETFORM',\n 'CHARSETID',\n 'CHAR_BASE',\n 'CHECK',\n 'CLOB_BASE',\n 'CLONE',\n 'CLOSE',\n 'CLUSTER',\n 'CLUSTERS',\n 'COALESCE',\n 'COLAUTH',\n 'COLLECT',\n 'COLUMNS',\n 'COMMENT',\n 'COMMIT',\n 'COMMITTED',\n 'COMPILED',\n 'COMPRESS',\n 'CONNECT',\n 'CONSTANT',\n 'CONSTRUCTOR',\n 'CONTEXT',\n 'CONTINUE',\n 'CONVERT',\n 'COUNT',\n 'CRASH',\n 'CREATE',\n 'CREDENTIAL',\n 'CURRENT',\n 'CURRVAL',\n 'CURSOR',\n 'CUSTOMDATUM',\n 'DANGLING',\n 'DATA',\n 'DATE',\n 'DATE_BASE',\n 'DAY',\n 'DECIMAL',\n 'DEFAULT',\n 'DEFINE',\n 'DEPTH',\n 'DESC',\n 'DETERMINISTIC',\n 'DIRECTORY',\n 'DISTINCT',\n 'DO',\n 'DOUBLE',\n 'DROP',\n 'DURATION',\n 'ELEMENT',\n 'ELSIF',\n 'EMPTY',\n 'ESCAPE',\n 'EXCEPTIONS',\n 'EXCLUSIVE',\n 'EXECUTE',\n 'EXISTS',\n 'EXIT',\n 'EXTENDS',\n 'EXTERNAL',\n 'EXTRACT',\n 'FALSE',\n 'FETCH',\n 'FINAL',\n 'FIRST',\n 'FIXED',\n 'FLOAT',\n 'FOR',\n 'FORALL',\n 'FORCE',\n 'FUNCTION',\n 'GENERAL',\n 'GOTO',\n 'GRANT',\n 'GROUP',\n 'HASH',\n 'HEAP',\n 'HIDDEN',\n 'HOUR',\n 'IDENTIFIED',\n 'IF',\n 'IMMEDIATE',\n 'IN',\n 'INCLUDING',\n 'INDEX',\n 'INDEXES',\n 'INDICATOR',\n 'INDICES',\n 'INFINITE',\n 'INSTANTIABLE',\n 'INT',\n 'INTEGER',\n 'INTERFACE',\n 'INTERVAL',\n 'INTO',\n 'INVALIDATE',\n 'IS',\n 'ISOLATION',\n 'JAVA',\n 'LANGUAGE',\n 'LARGE',\n 'LEADING',\n 'LENGTH',\n 'LEVEL',\n 'LIBRARY',\n 'LIKE',\n 'LIKE2',\n 'LIKE4',\n 'LIKEC',\n 'LIMITED',\n 'LOCAL',\n 'LOCK',\n 'LONG',\n 'MAP',\n 'MAX',\n 'MAXLEN',\n 'MEMBER',\n 'MERGE',\n 'MIN',\n 'MINUTE',\n 'MLSLABEL',\n 'MOD',\n 'MODE',\n 'MONTH',\n 'MULTISET',\n 'NAME',\n 'NAN',\n 'NATIONAL',\n 'NATIVE',\n 'NATURAL',\n 'NATURALN',\n 'NCHAR',\n 'NEW',\n 'NEXTVAL',\n 'NOCOMPRESS',\n 'NOCOPY',\n 'NOT',\n 'NOWAIT',\n 'NULL',\n 'NULLIF',\n 'NUMBER',\n 'NUMBER_BASE',\n 'OBJECT',\n 'OCICOLL',\n 'OCIDATE',\n 'OCIDATETIME',\n 'OCIDURATION',\n 'OCIINTERVAL',\n 'OCILOBLOCATOR',\n 'OCINUMBER',\n 'OCIRAW',\n 'OCIREF',\n 'OCIREFCURSOR',\n 'OCIROWID',\n 'OCISTRING',\n 'OCITYPE',\n 'OF',\n 'OLD',\n 'ON DELETE',\n 'ON UPDATE',\n 'ONLY',\n 'OPAQUE',\n 'OPEN',\n 'OPERATOR',\n 'OPTION',\n 'ORACLE',\n 'ORADATA',\n 'ORDER',\n 'ORGANIZATION',\n 'ORLANY',\n 'ORLVARY',\n 'OTHERS',\n 'OUT',\n 'OVERLAPS',\n 'OVERRIDING',\n 'PACKAGE',\n 'PARALLEL_ENABLE',\n 'PARAMETER',\n 'PARAMETERS',\n 'PARENT',\n 'PARTITION',\n 'PASCAL',\n 'PCTFREE',\n 'PIPE',\n 'PIPELINED',\n 'PLS_INTEGER',\n 'PLUGGABLE',\n 'POSITIVE',\n 'POSITIVEN',\n 'PRAGMA',\n 'PRECISION',\n 'PRIOR',\n 'PRIVATE',\n 'PROCEDURE',\n 'PUBLIC',\n 'RAISE',\n 'RANGE',\n 'RAW',\n 'READ',\n 'REAL',\n 'RECORD',\n 'REF',\n 'REFERENCE',\n 'RELEASE',\n 'RELIES_ON',\n 'REM',\n 'REMAINDER',\n 'RENAME',\n 'RESOURCE',\n 'RESULT',\n 'RESULT_CACHE',\n 'RETURN',\n 'REVERSE',\n 'REVOKE',\n 'ROLLBACK',\n 'ROW',\n 'ROWID',\n 'ROWNUM',\n 'ROWTYPE',\n 'SAMPLE',\n 'SAVE',\n 'SAVEPOINT',\n 'SB1',\n 'SB2',\n 'SB4',\n 'SEARCH',\n 'SECOND',\n 'SEGMENT',\n 'SELF',\n 'SEPARATE',\n 'SEQUENCE',\n 'SERIALIZABLE',\n 'SHARE',\n 'SHORT',\n 'SIZE',\n 'SIZE_T',\n 'SMALLINT',\n 'SOME',\n 'SPACE',\n 'SPARSE',\n 'SQL',\n 'SQLCODE',\n 'SQLDATA',\n 'SQLERRM',\n 'SQLNAME',\n 'SQLSTATE',\n 'STANDARD',\n 'START',\n 'STATIC',\n 'STDDEV',\n 'STORED',\n 'STRING',\n 'STRUCT',\n 'STYLE',\n 'SUBMULTISET',\n 'SUBPARTITION',\n 'SUBSTITUTABLE',\n 'SUBTYPE',\n 'SUCCESSFUL',\n 'SUM',\n 'SYNONYM',\n 'SYSDATE',\n 'TABAUTH',\n 'TABLE',\n 'TDO',\n 'THE',\n 'THEN',\n 'TIME',\n 'TIMESTAMP',\n 'TIMEZONE_ABBR',\n 'TIMEZONE_HOUR',\n 'TIMEZONE_MINUTE',\n 'TIMEZONE_REGION',\n 'TO',\n 'TRAILING',\n 'TRANSACTION',\n 'TRANSACTIONAL',\n 'TRIGGER',\n 'TRUE',\n 'TRUSTED',\n 'TYPE',\n 'UB1',\n 'UB2',\n 'UB4',\n 'UID',\n 'UNDER',\n 'UNIQUE',\n 'UNPLUG',\n 'UNSIGNED',\n 'UNTRUSTED',\n 'USE',\n 'USER',\n 'VALIDATE',\n 'VALIST',\n 'VALUE',\n 'VARCHAR',\n 'VARCHAR2',\n 'VARIABLE',\n 'VARIANCE',\n 'VARRAY',\n 'VARYING',\n 'VIEW',\n 'VIEWS',\n 'VOID',\n 'WHENEVER',\n 'WHILE',\n 'WORK',\n 'WRAPPED',\n 'WRITE',\n 'YEAR',\n 'ZONE',\n];\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\nconst reservedCommands = [\n 'ADD',\n 'ALTER COLUMN',\n 'ALTER TABLE',\n 'BEGIN',\n 'CONNECT BY',\n 'CREATE TABLE', // verify\n 'DROP TABLE', // verify\n 'DECLARE',\n // 'DELETE FROM', // disabled\n 'DELETE',\n 'END',\n 'EXCEPT',\n 'EXCEPTION',\n 'FETCH FIRST',\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'INSERT INTO',\n 'INSERT',\n 'LIMIT',\n 'OFFSET',\n 'LOOP',\n 'MODIFY',\n 'ORDER BY',\n 'RETURNING',\n 'SELECT',\n 'SET CURRENT SCHEMA',\n 'SET SCHEMA',\n 'SET',\n 'START WITH',\n 'UPDATE',\n 'VALUES',\n 'WHERE',\n 'WITH',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n 'MINUS',\n 'MINUS ALL',\n 'MINUS DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n // apply\n 'CROSS APPLY',\n 'OUTER APPLY',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\nexport default class PlSqlFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR', 'XOR'];\n static reservedKeywords = dedupe(reservedKeywords);\n static stringTypes: StringPatternType[] = [`\"\"`, \"N''\", \"''\", '``'];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = [':'];\n static lineCommentTypes = ['--'];\n static specialWordChars = { any: '_$#.@' };\n static operators = [\n '||',\n '**',\n ':=',\n '~=',\n '^=',\n '>>',\n '<<',\n '=>',\n // '..' // breaks operator test, handled by .\n ];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: PlSqlFormatter.reservedCommands,\n reservedBinaryCommands: PlSqlFormatter.reservedBinaryCommands,\n reservedDependentClauses: PlSqlFormatter.reservedDependentClauses,\n reservedJoinConditions: PlSqlFormatter.reservedJoinConditions,\n reservedLogicalOperators: PlSqlFormatter.reservedLogicalOperators,\n reservedKeywords: PlSqlFormatter.reservedKeywords,\n stringTypes: PlSqlFormatter.stringTypes,\n blockStart: PlSqlFormatter.blockStart,\n blockEnd: PlSqlFormatter.blockEnd,\n indexedPlaceholderTypes: PlSqlFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: PlSqlFormatter.namedPlaceholderTypes,\n lineCommentTypes: PlSqlFormatter.lineCommentTypes,\n specialWordChars: PlSqlFormatter.specialWordChars,\n operators: PlSqlFormatter.operators,\n });\n }\n\n tokenOverride(token: Token) {\n // `table`[.]`column`\n if (\n token.value === '.' &&\n this.tokenLookAhead().value.startsWith('`') &&\n this.tokenLookBehind().value.endsWith('`')\n ) {\n // This is an operator, do not insert spaces\n return { type: TokenType.OPERATOR, value: token.value };\n }\n\n // BY [SET]\n if (isToken.SET(token) && isToken.BY(this.getPreviousReservedToken())) {\n return { type: TokenType.RESERVED_KEYWORD, value: token.value };\n }\n\n return token;\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\n// https://www.postgresql.org/docs/14/functions.html\nconst reservedFunctions = {\n // https://www.postgresql.org/docs/14/functions-math.html\n math: [\n 'ABS',\n 'ACOS',\n 'ACOSD',\n 'ACOSH',\n 'ASIN',\n 'ASIND',\n 'ASINH',\n 'ATAN',\n 'ATAN2',\n 'ATAN2D',\n 'ATAND',\n 'ATANH',\n 'CBRT',\n 'CEIL',\n 'CEILING',\n 'COS',\n 'COSD',\n 'COSH',\n 'COT',\n 'COTD',\n 'DEGREES',\n 'DIV',\n 'EXP',\n 'FACTORIAL',\n 'FLOOR',\n 'GCD',\n 'LCM',\n 'LN',\n 'LOG',\n 'LOG10',\n 'MIN_SCALE',\n 'MOD',\n 'PI',\n 'POWER',\n 'RADIANS',\n 'RANDOM',\n 'ROUND',\n 'SCALE',\n 'SETSEED',\n 'SIGN',\n 'SIN',\n 'SIND',\n 'SINH',\n 'SQRT',\n 'TAN',\n 'TAND',\n 'TANH',\n 'TRIM_SCALE',\n 'TRUNC',\n 'WIDTH_BUCKET',\n ],\n // https://www.postgresql.org/docs/14/functions-string.html\n string: [\n 'ABS',\n 'ASCII',\n 'BIT_LENGTH',\n 'BTRIM',\n 'CHARACTER_LENGTH',\n 'CHAR_LENGTH',\n 'CHR',\n 'CONCAT',\n 'CONCAT_WS',\n 'FORMAT',\n 'INITCAP',\n 'LEFT',\n 'LENGTH',\n 'LOWER',\n 'LPAD',\n 'LTRIM',\n 'MD5',\n 'NORMALIZE',\n 'OCTET_LENGTH',\n 'OVERLAY',\n 'PARSE_IDENT',\n 'PG_CLIENT_ENCODING',\n 'POSITION',\n 'QUOTE_IDENT',\n 'QUOTE_LITERAL',\n 'QUOTE_NULLABLE',\n 'REGEXP_MATCH',\n 'REGEXP_MATCHES',\n 'REGEXP_REPLACE',\n 'REGEXP_SPLIT_TO_ARRAY',\n 'REGEXP_SPLIT_TO_TABLE',\n 'REPEAT',\n 'REPLACE',\n 'REVERSE',\n 'RIGHT',\n 'RPAD',\n 'RTRIM',\n 'SPLIT_PART',\n 'SPRINTF',\n 'STARTS_WITH',\n 'STRING_AGG',\n 'STRING_TO_ARRAY',\n 'STRING_TO_TABLE',\n 'STRPOS',\n 'SUBSTR',\n 'SUBSTRING',\n 'TO_ASCII',\n 'TO_HEX',\n 'TRANSLATE',\n 'TRIM',\n 'UNISTR',\n 'UPPER',\n ],\n // https://www.postgresql.org/docs/14/functions-binarystring.html\n binary: [\n 'BIT_COUNT',\n 'BIT_LENGTH',\n 'BTRIM',\n 'CONVERT',\n 'CONVERT_FROM',\n 'CONVERT_TO',\n 'DECODE',\n 'ENCODE',\n 'GET_BIT',\n 'GET_BYTE',\n 'LENGTH',\n 'LTRIM',\n 'MD5',\n 'OCTET_LENGTH',\n 'OVERLAY',\n 'POSITION',\n 'RTRIM',\n 'SET_BIT',\n 'SET_BYTE',\n 'SHA224',\n 'SHA256',\n 'SHA384',\n 'SHA512',\n 'STRING_AGG',\n 'SUBSTR',\n 'SUBSTRING',\n 'TRIM',\n ],\n // https://www.postgresql.org/docs/14/functions-bitstring.html\n bitstring: [\n 'BIT_COUNT',\n 'BIT_LENGTH',\n 'GET_BIT',\n 'LENGTH',\n 'OCTET_LENGTH',\n 'OVERLAY',\n 'POSITION',\n 'SET_BIT',\n 'SUBSTRING',\n ],\n // https://www.postgresql.org/docs/14/functions-matching.html\n pattern: [\n 'REGEXP_MATCH',\n 'REGEXP_MATCHES',\n 'REGEXP_REPLACE',\n 'REGEXP_SPLIT_TO_ARRAY',\n 'REGEXP_SPLIT_TO_TABLE',\n ],\n // https://www.postgresql.org/docs/14/functions-formatting.html\n datatype: ['TO_CHAR', 'TO_DATE', 'TO_NUMBER', 'TO_TIMESTAMP'],\n // https://www.postgresql.org/docs/14/functions-datetime.html\n datetime: [\n // 'AGE',\n 'CLOCK_TIMESTAMP',\n 'CURRENT_DATE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'DATE_BIN',\n 'DATE_PART',\n 'DATE_TRUNC',\n 'EXTRACT',\n 'ISFINITE',\n 'JUSTIFY_DAYS',\n 'JUSTIFY_HOURS',\n 'JUSTIFY_INTERVAL',\n 'LOCALTIME',\n 'LOCALTIMESTAMP',\n 'MAKE_DATE',\n 'MAKE_INTERVAL',\n 'MAKE_TIME',\n 'MAKE_TIMESTAMP',\n 'MAKE_TIMESTAMPTZ',\n 'NOW',\n 'PG_SLEEP',\n 'PG_SLEEP_FOR',\n 'PG_SLEEP_UNTIL',\n 'STATEMENT_TIMESTAMP',\n 'TIMEOFDAY',\n 'TO_TIMESTAMP',\n 'TRANSACTION_TIMESTAMP',\n ],\n // https://www.postgresql.org/docs/14/functions-enum.html\n enum: ['ENUM_FIRST', 'ENUM_LAST', 'ENUM_RANGE'],\n // https://www.postgresql.org/docs/14/functions-geometry.html\n geometry: [\n 'AREA',\n 'BOUND_BOX',\n 'BOX',\n 'CENTER',\n 'CIRCLE',\n 'DIAGONAL',\n 'DIAMETER',\n 'HEIGHT',\n 'ISCLOSED',\n 'ISOPEN',\n 'LENGTH',\n 'LINE',\n 'LSEG',\n 'NPOINTS',\n 'PATH',\n 'PCLOSE',\n 'POINT',\n 'POLYGON',\n 'POPEN',\n 'RADIUS',\n 'SLOPE',\n 'WIDTH',\n ],\n // https://www.postgresql.org/docs/14/functions-net.html\n network: [\n 'ABBREV',\n 'BROADCAST',\n 'FAMILY',\n 'HOST',\n 'HOSTMASK',\n 'INET_MERGE',\n 'INET_SAME_FAMILY',\n 'MACADDR8_SET7BIT',\n 'MASKLEN',\n 'NETMASK',\n 'NETWORK',\n 'SET_MASKLEN',\n 'TEXT',\n 'TRUNC',\n ],\n // https://www.postgresql.org/docs/14/functions-textsearch.html\n textsearch: [\n 'ARRAY_TO_TSVECTOR',\n 'GET_CURRENT_TS_CONFIG',\n 'JSONB_TO_TSVECTOR',\n 'JSON_TO_TSVECTOR',\n 'LENGTH',\n 'NUMNODE',\n 'PHRASETO_TSQUERY',\n 'PLAINTO_TSQUERY',\n 'QUERYTREE',\n 'SETWEIGHT',\n 'STRIP',\n 'TO_TSQUERY',\n 'TO_TSVECTOR',\n 'TSQUERY_PHRASE',\n 'TSVECTOR_TO_ARRAY',\n 'TS_DEBUG',\n 'TS_DELETE',\n 'TS_FILTER',\n 'TS_HEADLINE',\n 'TS_LEXIZE',\n 'TS_PARSE',\n 'TS_RANK',\n 'TS_RANK_CD',\n 'TS_REWRITE',\n 'TS_STAT',\n 'TS_TOKEN_TYPE',\n 'WEBSEARCH_TO_TSQUERY',\n ],\n // https://www.postgresql.org/docs/14/functions-uuid.html\n uuid: ['UUID'],\n // https://www.postgresql.org/docs/14/functions-xml.html\n xml: [\n 'CURSOR_TO_XML',\n 'CURSOR_TO_XMLSCHEMA',\n 'DATABASE_TO_XML',\n 'DATABASE_TO_XMLSCHEMA',\n 'DATABASE_TO_XML_AND_XMLSCHEMA',\n 'NEXTVAL',\n 'QUERY_TO_XML',\n 'QUERY_TO_XMLSCHEMA',\n 'QUERY_TO_XML_AND_XMLSCHEMA',\n 'SCHEMA_TO_XML',\n 'SCHEMA_TO_XMLSCHEMA',\n 'SCHEMA_TO_XML_AND_XMLSCHEMA',\n 'STRING',\n 'TABLE_TO_XML',\n 'TABLE_TO_XMLSCHEMA',\n 'TABLE_TO_XML_AND_XMLSCHEMA',\n 'XMLAGG',\n 'XMLCOMMENT',\n 'XMLCONCAT',\n 'XMLELEMENT',\n 'XMLEXISTS',\n 'XMLFOREST',\n 'XMLPARSE',\n 'XMLPI',\n 'XMLROOT',\n 'XMLSERIALIZE',\n 'XMLTABLE',\n 'XML_IS_WELL_FORMED',\n 'XML_IS_WELL_FORMED_CONTENT',\n 'XML_IS_WELL_FORMED_DOCUMENT',\n 'XPATH',\n 'XPATH_EXISTS',\n ],\n // https://www.postgresql.org/docs/14/functions-json.html\n json: [\n 'ARRAY_TO_JSON',\n 'JSONB_AGG',\n 'JSONB_ARRAY_ELEMENTS',\n 'JSONB_ARRAY_ELEMENTS_TEXT',\n 'JSONB_ARRAY_LENGTH',\n 'JSONB_BUILD_ARRAY',\n 'JSONB_BUILD_OBJECT',\n 'JSONB_EACH',\n 'JSONB_EACH_TEXT',\n 'JSONB_EXTRACT_PATH',\n 'JSONB_EXTRACT_PATH_TEXT',\n 'JSONB_INSERT',\n 'JSONB_OBJECT',\n 'JSONB_OBJECT_AGG',\n 'JSONB_OBJECT_KEYS',\n 'JSONB_PATH_EXISTS',\n 'JSONB_PATH_EXISTS_TZ',\n 'JSONB_PATH_MATCH',\n 'JSONB_PATH_MATCH_TZ',\n 'JSONB_PATH_QUERY',\n 'JSONB_PATH_QUERY_ARRAY',\n 'JSONB_PATH_QUERY_ARRAY_TZ',\n 'JSONB_PATH_QUERY_FIRST',\n 'JSONB_PATH_QUERY_FIRST_TZ',\n 'JSONB_PATH_QUERY_TZ',\n 'JSONB_POPULATE_RECORD',\n 'JSONB_POPULATE_RECORDSET',\n 'JSONB_PRETTY',\n 'JSONB_SET',\n 'JSONB_SET_LAX',\n 'JSONB_STRIP_NULLS',\n 'JSONB_TO_RECORD',\n 'JSONB_TO_RECORDSET',\n 'JSONB_TYPEOF',\n 'JSON_AGG',\n 'JSON_ARRAY_ELEMENTS',\n 'JSON_ARRAY_ELEMENTS_TEXT',\n 'JSON_ARRAY_LENGTH',\n 'JSON_BUILD_ARRAY',\n 'JSON_BUILD_OBJECT',\n 'JSON_EACH',\n 'JSON_EACH_TEXT',\n 'JSON_EXTRACT_PATH',\n 'JSON_EXTRACT_PATH_TEXT',\n 'JSON_OBJECT',\n 'JSON_OBJECT_AGG',\n 'JSON_OBJECT_KEYS',\n 'JSON_POPULATE_RECORD',\n 'JSON_POPULATE_RECORDSET',\n 'JSON_STRIP_NULLS',\n 'JSON_TO_RECORD',\n 'JSON_TO_RECORDSET',\n 'JSON_TYPEOF',\n 'ROW_TO_JSON',\n 'TO_JSON',\n 'TO_JSONB',\n 'TO_TIMESTAMP',\n ],\n // https://www.postgresql.org/docs/14/functions-sequence.html\n sequence: ['CURRVAL', 'LASTVAL', 'NEXTVAL', 'SETVAL'],\n // https://www.postgresql.org/docs/14/functions-conditional.html\n conditional: [\n // 'CASE',\n 'COALESCE',\n 'GREATEST',\n 'LEAST',\n 'NULLIF',\n ],\n // https://www.postgresql.org/docs/14/functions-array.html\n array: [\n 'ARRAY_AGG',\n 'ARRAY_APPEND',\n 'ARRAY_CAT',\n 'ARRAY_DIMS',\n 'ARRAY_FILL',\n 'ARRAY_LENGTH',\n 'ARRAY_LOWER',\n 'ARRAY_NDIMS',\n 'ARRAY_POSITION',\n 'ARRAY_POSITIONS',\n 'ARRAY_PREPEND',\n 'ARRAY_REMOVE',\n 'ARRAY_REPLACE',\n 'ARRAY_TO_STRING',\n 'ARRAY_UPPER',\n 'CARDINALITY',\n 'STRING_TO_ARRAY',\n 'TRIM_ARRAY',\n 'UNNEST',\n ],\n // https://www.postgresql.org/docs/14/functions-range.html\n range: [\n 'ISEMPTY',\n 'LOWER',\n 'LOWER_INC',\n 'LOWER_INF',\n 'MULTIRANGE',\n 'RANGE_MERGE',\n 'UPPER',\n 'UPPER_INC',\n 'UPPER_INF',\n ],\n // https://www.postgresql.org/docs/14/functions-aggregate.html\n aggregate: [\n 'ANY',\n 'ARRAY_AGG',\n 'AVG',\n 'BIT_AND',\n 'BIT_OR',\n 'BIT_XOR',\n 'BOOL_AND',\n 'BOOL_OR',\n 'COALESCE',\n 'CORR',\n 'COUNT',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'CUME_DIST',\n 'DENSE_RANK',\n 'EVERY',\n 'GROUPING',\n 'JSONB_AGG',\n 'JSONB_OBJECT_AGG',\n 'JSON_AGG',\n 'JSON_OBJECT_AGG',\n 'MAX',\n 'MIN',\n 'MODE',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'PERCENT_RANK',\n 'RANGE_AGG',\n 'RANGE_INTERSECT_AGG',\n 'RANK',\n 'REGR_AVGX',\n 'REGR_AVGY',\n 'REGR_COUNT',\n 'REGR_INTERCEPT',\n 'REGR_R2',\n 'REGR_SLOPE',\n 'REGR_SXX',\n 'REGR_SXY',\n 'REGR_SYY',\n 'SOME',\n 'STDDEV',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'STRING_AGG',\n 'SUM',\n 'TO_JSON',\n 'TO_JSONB',\n 'VARIANCE',\n 'VAR_POP',\n 'VAR_SAMP',\n 'XMLAGG',\n ],\n // https://www.postgresql.org/docs/14/functions-window.html\n window: [\n 'CUME_DIST',\n 'DENSE_RANK',\n 'FIRST_VALUE',\n 'LAG',\n 'LAST_VALUE',\n 'LEAD',\n 'NTH_VALUE',\n 'NTILE',\n 'PERCENT_RANK',\n 'RANK',\n 'ROW_NUMBER',\n ],\n // https://www.postgresql.org/docs/14/functions-srf.html\n set: ['GENERATE_SERIES', 'GENERATE_SUBSCRIPTS'],\n // https://www.postgresql.org/docs/14/functions-info.html\n sysInfo: [\n 'ACLDEFAULT',\n 'ACLEXPLODE',\n 'COL_DESCRIPTION',\n 'CURRENT_CATALOG',\n 'CURRENT_DATABASE',\n 'CURRENT_QUERY',\n 'CURRENT_ROLE',\n 'CURRENT_SCHEMA',\n 'CURRENT_SCHEMAS',\n 'CURRENT_USER',\n 'FORMAT_TYPE',\n 'HAS_ANY_COLUMN_PRIVILEGE',\n 'HAS_COLUMN_PRIVILEGE',\n 'HAS_DATABASE_PRIVILEGE',\n 'HAS_FOREIGN_DATA_WRAPPER_PRIVILEGE',\n 'HAS_FUNCTION_PRIVILEGE',\n 'HAS_LANGUAGE_PRIVILEGE',\n 'HAS_SCHEMA_PRIVILEGE',\n 'HAS_SEQUENCE_PRIVILEGE',\n 'HAS_SERVER_PRIVILEGE',\n 'HAS_TABLESPACE_PRIVILEGE',\n 'HAS_TABLE_PRIVILEGE',\n 'HAS_TYPE_PRIVILEGE',\n 'INET_CLIENT_ADDR',\n 'INET_CLIENT_PORT',\n 'INET_SERVER_ADDR',\n 'INET_SERVER_PORT',\n 'MAKEACLITEM',\n 'OBJ_DESCRIPTION',\n 'PG_BACKEND_PID',\n 'PG_BLOCKING_PIDS',\n 'PG_COLLATION_IS_VISIBLE',\n 'PG_CONF_LOAD_TIME',\n 'PG_CONTROL_CHECKPOINT',\n 'PG_CONTROL_INIT',\n 'PG_CONTROL_SYSTEM',\n 'PG_CONVERSION_IS_VISIBLE',\n 'PG_CURRENT_LOGFILE',\n 'PG_CURRENT_SNAPSHOT',\n 'PG_CURRENT_XACT_ID',\n 'PG_CURRENT_XACT_ID_IF_ASSIGNED',\n 'PG_DESCRIBE_OBJECT',\n 'PG_FUNCTION_IS_VISIBLE',\n 'PG_GET_CATALOG_FOREIGN_KEYS',\n 'PG_GET_CONSTRAINTDEF',\n 'PG_GET_EXPR',\n 'PG_GET_FUNCTIONDEF',\n 'PG_GET_FUNCTION_ARGUMENTS',\n 'PG_GET_FUNCTION_IDENTITY_ARGUMENTS',\n 'PG_GET_FUNCTION_RESULT',\n 'PG_GET_INDEXDEF',\n 'PG_GET_KEYWORDS',\n 'PG_GET_OBJECT_ADDRESS',\n 'PG_GET_OWNED_SEQUENCE',\n 'PG_GET_RULEDEF',\n 'PG_GET_SERIAL_SEQUENCE',\n 'PG_GET_STATISTICSOBJDEF',\n 'PG_GET_TRIGGERDEF',\n 'PG_GET_USERBYID',\n 'PG_GET_VIEWDEF',\n 'PG_HAS_ROLE',\n 'PG_IDENTIFY_OBJECT',\n 'PG_IDENTIFY_OBJECT_AS_ADDRESS',\n 'PG_INDEXAM_HAS_PROPERTY',\n 'PG_INDEX_COLUMN_HAS_PROPERTY',\n 'PG_INDEX_HAS_PROPERTY',\n 'PG_IS_OTHER_TEMP_SCHEMA',\n 'PG_JIT_AVAILABLE',\n 'PG_LAST_COMMITTED_XACT',\n 'PG_LISTENING_CHANNELS',\n 'PG_MY_TEMP_SCHEMA',\n 'PG_NOTIFICATION_QUEUE_USAGE',\n 'PG_OPCLASS_IS_VISIBLE',\n 'PG_OPERATOR_IS_VISIBLE',\n 'PG_OPFAMILY_IS_VISIBLE',\n 'PG_OPTIONS_TO_TABLE',\n 'PG_POSTMASTER_START_TIME',\n 'PG_SAFE_SNAPSHOT_BLOCKING_PIDS',\n 'PG_SNAPSHOT_XIP',\n 'PG_SNAPSHOT_XMAX',\n 'PG_SNAPSHOT_XMIN',\n 'PG_STATISTICS_OBJ_IS_VISIBLE',\n 'PG_TABLESPACE_DATABASES',\n 'PG_TABLESPACE_LOCATION',\n 'PG_TABLE_IS_VISIBLE',\n 'PG_TRIGGER_DEPTH',\n 'PG_TS_CONFIG_IS_VISIBLE',\n 'PG_TS_DICT_IS_VISIBLE',\n 'PG_TS_PARSER_IS_VISIBLE',\n 'PG_TS_TEMPLATE_IS_VISIBLE',\n 'PG_TYPEOF',\n 'PG_TYPE_IS_VISIBLE',\n 'PG_VISIBLE_IN_SNAPSHOT',\n 'PG_XACT_COMMIT_TIMESTAMP',\n 'PG_XACT_COMMIT_TIMESTAMP_ORIGIN',\n 'PG_XACT_STATUS',\n 'PQSERVERVERSION',\n 'ROW_SECURITY_ACTIVE',\n 'SESSION_USER',\n 'SHOBJ_DESCRIPTION',\n 'TO_REGCLASS',\n 'TO_REGCOLLATION',\n 'TO_REGNAMESPACE',\n 'TO_REGOPER',\n 'TO_REGOPERATOR',\n 'TO_REGPROC',\n 'TO_REGPROCEDURE',\n 'TO_REGROLE',\n 'TO_REGTYPE',\n 'TXID_CURRENT',\n 'TXID_CURRENT_IF_ASSIGNED',\n 'TXID_CURRENT_SNAPSHOT',\n 'TXID_SNAPSHOT_XIP',\n 'TXID_SNAPSHOT_XMAX',\n 'TXID_SNAPSHOT_XMIN',\n 'TXID_STATUS',\n 'TXID_VISIBLE_IN_SNAPSHOT',\n 'USER',\n 'VERSION',\n ],\n // https://www.postgresql.org/docs/14/functions-admin.html\n sysAdmin: [\n 'BRIN_DESUMMARIZE_RANGE',\n 'BRIN_SUMMARIZE_NEW_VALUES',\n 'BRIN_SUMMARIZE_RANGE',\n 'CONVERT_FROM',\n 'CURRENT_SETTING',\n 'GIN_CLEAN_PENDING_LIST',\n 'PG_ADVISORY_LOCK',\n 'PG_ADVISORY_LOCK_SHARED',\n 'PG_ADVISORY_UNLOCK',\n 'PG_ADVISORY_UNLOCK_ALL',\n 'PG_ADVISORY_UNLOCK_SHARED',\n 'PG_ADVISORY_XACT_LOCK',\n 'PG_ADVISORY_XACT_LOCK_SHARED',\n 'PG_BACKUP_START_TIME',\n 'PG_CANCEL_BACKEND',\n 'PG_COLLATION_ACTUAL_VERSION',\n 'PG_COLUMN_COMPRESSION',\n 'PG_COLUMN_SIZE',\n 'PG_COPY_LOGICAL_REPLICATION_SLOT',\n 'PG_COPY_PHYSICAL_REPLICATION_SLOT',\n 'PG_CREATE_LOGICAL_REPLICATION_SLOT',\n 'PG_CREATE_PHYSICAL_REPLICATION_SLOT',\n 'PG_CREATE_RESTORE_POINT',\n 'PG_CURRENT_WAL_FLUSH_LSN',\n 'PG_CURRENT_WAL_INSERT_LSN',\n 'PG_CURRENT_WAL_LSN',\n 'PG_DATABASE_SIZE',\n 'PG_DROP_REPLICATION_SLOT',\n 'PG_EXPORT_SNAPSHOT',\n 'PG_FILENODE_RELATION',\n 'PG_GET_WAL_REPLAY_PAUSE_STATE',\n 'PG_IMPORT_SYSTEM_COLLATIONS',\n 'PG_INDEXES_SIZE',\n 'PG_IS_IN_BACKUP',\n 'PG_IS_IN_RECOVERY',\n 'PG_IS_WAL_REPLAY_PAUSED',\n 'PG_LAST_WAL_RECEIVE_LSN',\n 'PG_LAST_WAL_REPLAY_LSN',\n 'PG_LAST_XACT_REPLAY_TIMESTAMP',\n 'PG_LOGICAL_EMIT_MESSAGE',\n 'PG_LOGICAL_SLOT_GET_BINARY_CHANGES',\n 'PG_LOGICAL_SLOT_GET_CHANGES',\n 'PG_LOGICAL_SLOT_PEEK_BINARY_CHANGES',\n 'PG_LOGICAL_SLOT_PEEK_CHANGES',\n 'PG_LOG_BACKEND_MEMORY_CONTEXTS',\n 'PG_LS_ARCHIVE_STATUSDIR',\n 'PG_LS_DIR',\n 'PG_LS_LOGDIR',\n 'PG_LS_TMPDIR',\n 'PG_LS_WALDIR',\n 'PG_PARTITION_ANCESTORS',\n 'PG_PARTITION_ROOT',\n 'PG_PARTITION_TREE',\n 'PG_PROMOTE',\n 'PG_READ_BINARY_FILE',\n 'PG_READ_FILE',\n 'PG_RELATION_FILENODE',\n 'PG_RELATION_FILEPATH',\n 'PG_RELATION_SIZE',\n 'PG_RELOAD_CONF',\n 'PG_REPLICATION_ORIGIN_ADVANCE',\n 'PG_REPLICATION_ORIGIN_CREATE',\n 'PG_REPLICATION_ORIGIN_DROP',\n 'PG_REPLICATION_ORIGIN_OID',\n 'PG_REPLICATION_ORIGIN_PROGRESS',\n 'PG_REPLICATION_ORIGIN_SESSION_IS_SETUP',\n 'PG_REPLICATION_ORIGIN_SESSION_PROGRESS',\n 'PG_REPLICATION_ORIGIN_SESSION_RESET',\n 'PG_REPLICATION_ORIGIN_SESSION_SETUP',\n 'PG_REPLICATION_ORIGIN_XACT_RESET',\n 'PG_REPLICATION_ORIGIN_XACT_SETUP',\n 'PG_REPLICATION_SLOT_ADVANCE',\n 'PG_ROTATE_LOGFILE',\n 'PG_SIZE_BYTES',\n 'PG_SIZE_PRETTY',\n 'PG_START_BACKUP',\n 'PG_STAT_FILE',\n 'PG_STOP_BACKUP',\n 'PG_SWITCH_WAL',\n 'PG_TABLESPACE_SIZE',\n 'PG_TABLE_SIZE',\n 'PG_TERMINATE_BACKEND',\n 'PG_TOTAL_RELATION_SIZE',\n 'PG_TRY_ADVISORY_LOCK',\n 'PG_TRY_ADVISORY_LOCK_SHARED',\n 'PG_TRY_ADVISORY_XACT_LOCK',\n 'PG_TRY_ADVISORY_XACT_LOCK_SHARED',\n 'PG_WALFILE_NAME',\n 'PG_WALFILE_NAME_OFFSET',\n 'PG_WAL_LSN_DIFF',\n 'PG_WAL_REPLAY_PAUSE',\n 'PG_WAL_REPLAY_RESUME',\n 'SET_CONFIG',\n ],\n // https://www.postgresql.org/docs/14/functions-trigger.html\n trigger: [\n 'SUPPRESS_REDUNDANT_UPDATES_TRIGGER',\n 'TSVECTOR_UPDATE_TRIGGER',\n 'TSVECTOR_UPDATE_TRIGGER_COLUMN',\n ],\n // https://www.postgresql.org/docs/14/functions-event-triggers.html\n eventTrigger: [\n 'PG_EVENT_TRIGGER_DDL_COMMANDS',\n 'PG_EVENT_TRIGGER_DROPPED_OBJECTS',\n 'PG_EVENT_TRIGGER_TABLE_REWRITE_OID',\n 'PG_EVENT_TRIGGER_TABLE_REWRITE_REASON',\n 'PG_GET_OBJECT_ADDRESS',\n ],\n // https://www.postgresql.org/docs/14/functions-statistics.html\n stats: ['PG_MCV_LIST_ITEMS'],\n};\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\n// https://www.postgresql.org/docs/14/sql-keywords-appendix.html\nconst reservedKeywords = [\n 'ABSENT',\n 'ABSOLUTE',\n 'ACCESS',\n 'ACCORDING',\n 'ACTION',\n 'ADA',\n 'ADMIN',\n 'AGGREGATE',\n 'ALL',\n 'ALLOCATE',\n 'ALSO',\n 'ALTER',\n 'ALWAYS',\n 'ANALYSE',\n 'ARE',\n 'ARRAY',\n 'ARRAY_MAX_CARDINALITY',\n 'AS',\n 'ASC',\n 'ASENSITIVE',\n 'ASSERTION',\n 'ASSIGNMENT',\n 'ASYMMETRIC',\n 'AT',\n 'ATOMIC',\n 'ATTACH',\n 'ATTRIBUTE',\n 'ATTRIBUTES',\n 'AUTHORIZATION',\n 'BACKWARD',\n 'BASE64',\n 'BEFORE',\n 'BEGIN_FRAME',\n 'BEGIN_PARTITION',\n 'BERNOULLI',\n 'BETWEEN',\n 'BIGINT',\n 'BINARY',\n 'BIT',\n 'BLOB',\n 'BLOCKED',\n 'BOM',\n 'BOOLEAN',\n 'BOTH',\n 'BREADTH',\n 'BY',\n 'CACHE',\n 'CALLED',\n 'CASCADE',\n 'CASCADED',\n 'CAST',\n 'CATALOG',\n 'CATALOG_NAME',\n 'CHAIN',\n 'CHAINING',\n 'CHAR',\n 'CHARACTER',\n 'CHARACTERISTICS',\n 'CHARACTERS',\n 'CHARACTER_SET_CATALOG',\n 'CHARACTER_SET_NAME',\n 'CHARACTER_SET_SCHEMA',\n 'CHECK',\n 'CLASS',\n 'CLASSIFIER',\n 'CLASS_ORIGIN',\n 'CLOB',\n 'COBOL',\n 'COLLATE',\n 'COLLATION',\n 'COLLATION_CATALOG',\n 'COLLATION_NAME',\n 'COLLATION_SCHEMA',\n 'COLLECT',\n 'COLUMN',\n 'COLUMNS',\n 'COLUMN_NAME',\n 'COMMAND_FUNCTION',\n 'COMMAND_FUNCTION_CODE',\n 'COMMENTS',\n 'COMMITTED',\n 'COMPRESSION',\n 'CONCURRENTLY',\n 'CONDITION',\n 'CONDITIONAL',\n 'CONDITION_NUMBER',\n 'CONFIGURATION',\n 'CONFLICT',\n 'CONNECT',\n 'CONNECTION',\n 'CONNECTION_NAME',\n 'CONSTRAINT',\n 'CONSTRAINTS',\n 'CONSTRAINT_CATALOG',\n 'CONSTRAINT_NAME',\n 'CONSTRAINT_SCHEMA',\n 'CONSTRUCTOR',\n 'CONTAINS',\n 'CONTENT',\n 'CONTINUE',\n 'CONTROL',\n 'CONVERSION',\n 'CORRESPONDING',\n 'COST',\n 'CREATE',\n 'CROSS',\n 'CSV',\n 'CUBE',\n 'CURRENT',\n 'CURRENT_DEFAULT_TRANSFORM_GROUP',\n 'CURRENT_PATH',\n 'CURRENT_ROW',\n 'CURRENT_TRANSFORM_GROUP_FOR_TYPE',\n 'CURSOR',\n 'CURSOR_NAME',\n 'CYCLE',\n 'DATA',\n 'DATABASE',\n 'DATALINK',\n 'DATE',\n 'DATETIME_INTERVAL_CODE',\n 'DATETIME_INTERVAL_PRECISION',\n 'DAY',\n 'DB',\n 'DEC',\n 'DECFLOAT',\n 'DECIMAL',\n 'DEFAULT',\n 'DEFAULTS',\n 'DEFERRABLE',\n 'DEFERRED',\n 'DEFINE',\n 'DEFINED',\n 'DEFINER',\n 'DEGREE',\n 'DELIMITER',\n 'DELIMITERS',\n 'DEPENDS',\n 'DEPTH',\n 'DEREF',\n 'DERIVED',\n 'DESC',\n 'DESCRIBE',\n 'DESCRIPTOR',\n 'DETACH',\n 'DETERMINISTIC',\n 'DIAGNOSTICS',\n 'DICTIONARY',\n 'DISABLE',\n 'DISCONNECT',\n 'DISPATCH',\n 'DISTINCT',\n 'DLNEWCOPY',\n 'DLPREVIOUSCOPY',\n 'DLURLCOMPLETE',\n 'DLURLCOMPLETEONLY',\n 'DLURLCOMPLETEWRITE',\n 'DLURLPATH',\n 'DLURLPATHONLY',\n 'DLURLPATHWRITE',\n 'DLURLSCHEME',\n 'DLURLSERVER',\n 'DLVALUE',\n 'DOCUMENT',\n 'DOMAIN',\n 'DOUBLE',\n 'DROP',\n 'DYNAMIC',\n 'DYNAMIC_FUNCTION',\n 'DYNAMIC_FUNCTION_CODE',\n 'EACH',\n 'ELEMENT',\n 'EMPTY',\n 'ENABLE',\n 'ENCODING',\n 'ENCRYPTED',\n 'END-EXEC',\n 'END_FRAME',\n 'END_PARTITION',\n 'ENFORCED',\n 'ENUM',\n 'EQUALS',\n 'ERROR',\n 'ESCAPE',\n 'EVENT',\n 'EXCEPTION',\n 'EXCLUDE',\n 'EXCLUDING',\n 'EXCLUSIVE',\n 'EXEC',\n 'EXISTS',\n 'EXPRESSION',\n 'EXTENSION',\n 'EXTERNAL',\n 'FALSE',\n 'FILE',\n 'FILTER',\n 'FINAL',\n 'FINALIZE',\n 'FINISH',\n 'FIRST',\n 'FLAG',\n 'FLOAT',\n 'FOLLOWING',\n 'FOR',\n 'FORCE',\n 'FOREIGN',\n 'FORTRAN',\n 'FORWARD',\n 'FOUND',\n 'FRAME_ROW',\n 'FREE',\n 'FREEZE',\n 'FS',\n 'FULFILL',\n 'FULL',\n 'FUNCTION',\n 'FUNCTIONS',\n 'FUSION',\n 'GENERAL',\n 'GENERATED',\n 'GET',\n 'GLOBAL',\n 'GO',\n 'GOTO',\n 'GRANTED',\n 'GROUP',\n 'GROUPS',\n 'HANDLER',\n 'HEADER',\n 'HEX',\n 'HIERARCHY',\n 'HOLD',\n 'HOUR',\n // 'ID',\n 'IDENTITY',\n 'IF',\n 'IGNORE',\n 'ILIKE',\n 'IMMEDIATE',\n 'IMMEDIATELY',\n 'IMMUTABLE',\n 'IMPLEMENTATION',\n 'IMPLICIT',\n 'IMPORT',\n 'IN',\n 'INCLUDE',\n 'INCLUDING',\n 'INCREMENT',\n 'INDENT',\n 'INDEX',\n 'INDEXES',\n 'INDICATOR',\n 'INHERIT',\n 'INHERITS',\n 'INITIAL',\n 'INITIALLY',\n 'INLINE',\n 'INNER',\n 'INOUT',\n 'INPUT',\n 'INSENSITIVE',\n 'INSTANCE',\n 'INSTANTIABLE',\n 'INSTEAD',\n 'INT',\n 'INTEGER',\n 'INTEGRITY',\n 'INTERSECTION',\n 'INTERVAL',\n 'INTO',\n 'INVOKER',\n 'IS',\n 'ISNULL',\n 'ISOLATION',\n 'JSON',\n 'JSON_ARRAY',\n 'JSON_ARRAYAGG',\n 'JSON_EXISTS',\n 'JSON_OBJECTAGG',\n 'JSON_QUERY',\n 'JSON_TABLE',\n 'JSON_TABLE_PRIMITIVE',\n 'JSON_VALUE',\n 'KEEP',\n 'KEY',\n 'KEYS',\n 'KEY_MEMBER',\n 'KEY_TYPE',\n 'LABEL',\n 'LANGUAGE',\n 'LARGE',\n 'LAST',\n 'LATERAL',\n 'LEADING',\n 'LEAKPROOF',\n 'LEVEL',\n 'LIBRARY',\n 'LIKE',\n 'LIKE_REGEX',\n 'LINK',\n 'LISTAGG',\n 'LOCAL',\n 'LOCATION',\n 'LOCATOR',\n 'LOCKED',\n 'LOGGED',\n 'MAP',\n 'MAPPING',\n 'MATCH',\n 'MATCHED',\n 'MATCHES',\n 'MATCH_NUMBER',\n 'MATCH_RECOGNIZE',\n 'MATERIALIZED',\n 'MAXVALUE',\n 'MEASURES',\n 'MEMBER',\n 'MERGE',\n 'MESSAGE_LENGTH',\n 'MESSAGE_OCTET_LENGTH',\n 'MESSAGE_TEXT',\n 'METHOD',\n 'MINUTE',\n 'MINVALUE',\n 'MODIFIES',\n 'MODULE',\n 'MONTH',\n 'MORE',\n 'MULTISET',\n 'MUMPS',\n 'NAME',\n 'NAMES',\n 'NAMESPACE',\n 'NATIONAL',\n 'NATURAL',\n 'NCHAR',\n 'NCLOB',\n 'NESTED',\n 'NESTING',\n 'NEW',\n 'NEXT',\n 'NFC',\n 'NFD',\n 'NFKC',\n 'NFKD',\n 'NIL',\n 'NO',\n 'NONE',\n 'NORMALIZED',\n 'NOT',\n 'NOTHING',\n 'NOTNULL',\n 'NOWAIT',\n 'NULL',\n 'NULLABLE',\n 'NULLS',\n 'NUMBER',\n 'NUMERIC',\n 'OBJECT',\n 'OCCURRENCES_REGEX',\n 'OCTETS',\n 'OF',\n 'OFF',\n 'OFFSET',\n 'OIDS',\n 'OLD',\n 'OMIT',\n 'ON COMMIT',\n 'ON DELETE',\n 'ON UPDATE',\n 'ONE',\n 'ONLY',\n 'OPEN',\n 'OPERATOR',\n 'OPTION',\n 'OPTIONS',\n 'ORDER',\n 'ORDERING',\n 'ORDINALITY',\n 'OTHERS',\n 'OUT',\n 'OUTER',\n 'OUTPUT',\n 'OVER',\n 'OVERFLOW',\n 'OVERLAPS',\n 'OVERRIDING',\n 'OWNED',\n 'OWNER',\n 'PAD',\n 'PARALLEL',\n 'PARAMETER',\n 'PARAMETER_MODE',\n 'PARAMETER_NAME',\n 'PARAMETER_ORDINAL_POSITION',\n 'PARAMETER_SPECIFIC_CATALOG',\n 'PARAMETER_SPECIFIC_NAME',\n 'PARAMETER_SPECIFIC_SCHEMA',\n 'PARSER',\n 'PARTIAL',\n 'PARTITION',\n 'PASCAL',\n 'PASS',\n 'PASSING',\n 'PASSTHROUGH',\n 'PASSWORD',\n 'PAST',\n 'PATTERN',\n 'PER',\n 'PERCENT',\n 'PERIOD',\n 'PERMISSION',\n 'PERMUTE',\n 'PLACING',\n 'PLAN',\n 'PLANS',\n 'PLI',\n 'POLICY',\n 'PORTION',\n 'POSITION_REGEX',\n 'PRECEDES',\n 'PRECEDING',\n 'PRECISION',\n 'PREPARED',\n 'PRESERVE',\n 'PRIMARY',\n 'PRIOR',\n 'PRIVATE',\n 'PRIVILEGES',\n 'PROCEDURAL',\n 'PROCEDURE',\n 'PROCEDURES',\n 'PROGRAM',\n 'PRUNE',\n 'PTF',\n 'PUBLIC',\n 'PUBLICATION',\n 'QUOTE',\n 'QUOTES',\n 'RANGE',\n 'READ',\n 'READS',\n 'REAL',\n 'REASSIGN',\n 'RECHECK',\n 'RECOVERY',\n 'RECURSIVE',\n 'REF',\n 'REFERENCES',\n 'REFERENCING',\n 'REFRESH',\n 'RELATIVE',\n 'RELEASE',\n 'RENAME',\n 'REPEATABLE',\n 'REPLICA',\n 'REQUIRING',\n 'RESPECT',\n 'RESTART',\n 'RESTORE',\n 'RESTRICT',\n 'RESULT',\n 'RETURN',\n 'RETURNED_CARDINALITY',\n 'RETURNED_LENGTH',\n 'RETURNED_OCTET_LENGTH',\n 'RETURNED_SQLSTATE',\n 'RETURNS',\n 'ROLE',\n 'ROLLUP',\n 'ROUTINE',\n 'ROUTINES',\n 'ROUTINE_CATALOG',\n 'ROUTINE_NAME',\n 'ROUTINE_SCHEMA',\n 'ROW',\n 'ROWS',\n 'ROW_COUNT',\n 'RULE',\n 'RUNNING',\n 'SCALAR',\n 'SCHEMA',\n 'SCHEMAS',\n 'SCHEMA_NAME',\n 'SCOPE',\n 'SCOPE_CATALOG',\n 'SCOPE_NAME',\n 'SCOPE_SCHEMA',\n 'SCROLL',\n 'SEARCH',\n 'SECOND',\n 'SECTION',\n 'SECURITY',\n 'SEEK',\n 'SELECTIVE',\n 'SELF',\n 'SENSITIVE',\n 'SEQUENCE',\n 'SEQUENCES',\n 'SERIALIZABLE',\n 'SERVER',\n 'SERVER_NAME',\n 'SESSION',\n 'SETOF',\n 'SETS',\n 'SHARE',\n 'SIMILAR',\n 'SIMPLE',\n 'SIZE',\n 'SKIP',\n 'SMALLINT',\n 'SNAPSHOT',\n 'SOURCE',\n 'SPACE',\n 'SPECIFIC',\n 'SPECIFICTYPE',\n 'SPECIFIC_NAME',\n 'SQL',\n 'SQLCODE',\n 'SQLERROR',\n 'SQLEXCEPTION',\n 'SQLSTATE',\n 'SQLWARNING',\n 'STABLE',\n 'STANDALONE',\n 'START',\n 'STATE',\n 'STATEMENT',\n 'STATIC',\n 'STATISTICS',\n 'STDIN',\n 'STDOUT',\n 'STORAGE',\n 'STORED',\n 'STRICT',\n 'STRUCTURE',\n 'STYLE',\n 'SUBCLASS_ORIGIN',\n 'SUBMULTISET',\n 'SUBSCRIPTION',\n 'SUBSET',\n 'SUBSTRING_REGEX',\n 'SUCCEEDS',\n 'SUPPORT',\n 'SYMMETRIC',\n 'SYSID',\n 'SYSTEM',\n 'SYSTEM_TIME',\n 'SYSTEM_USER',\n 'TABLE',\n 'TABLES',\n 'TABLESAMPLE',\n 'TABLESPACE',\n 'TABLE_NAME',\n 'TEMP',\n 'TEMPLATE',\n 'TEMPORARY',\n 'THEN',\n 'THROUGH',\n 'TIES',\n 'TIME',\n 'TIMESTAMP',\n 'TIMEZONE_HOUR',\n 'TIMEZONE_MINUTE',\n 'TO',\n 'TOKEN',\n 'TOP_LEVEL_COUNT',\n 'TRAILING',\n 'TRANSACTION',\n 'TRANSACTIONS_COMMITTED',\n 'TRANSACTIONS_ROLLED_BACK',\n 'TRANSACTION_ACTIVE',\n 'TRANSFORM',\n 'TRANSFORMS',\n 'TRANSLATE_REGEX',\n 'TRANSLATION',\n 'TREAT',\n 'TRIGGER',\n 'TRIGGER_CATALOG',\n 'TRIGGER_NAME',\n 'TRIGGER_SCHEMA',\n 'TRUE',\n 'TRUSTED',\n 'TYPE',\n 'TYPES',\n 'UESCAPE',\n 'UNBOUNDED',\n 'UNCOMMITTED',\n 'UNCONDITIONAL',\n 'UNDER',\n 'UNENCRYPTED',\n 'UNIQUE',\n 'UNKNOWN',\n 'UNLINK',\n 'UNLOGGED',\n 'UNMATCHED',\n 'UNNAMED',\n 'UNTIL',\n 'UNTYPED',\n 'URI',\n 'USAGE',\n 'USER_DEFINED_TYPE_CATALOG',\n 'USER_DEFINED_TYPE_CODE',\n 'USER_DEFINED_TYPE_NAME',\n 'USER_DEFINED_TYPE_SCHEMA',\n 'UTF16',\n 'UTF32',\n 'UTF8',\n 'VALID',\n 'VALIDATE',\n 'VALIDATOR',\n 'VALUE',\n 'VALUE_OF',\n 'VARBINARY',\n 'VARCHAR',\n 'VARIADIC',\n 'VARYING',\n 'VERBOSE',\n 'VERSIONING',\n 'VIEW',\n 'VIEWS',\n 'VOLATILE',\n 'WHENEVER',\n 'WHITESPACE',\n 'WINDOW',\n 'WITHIN',\n 'WITHOUT',\n 'WORK',\n 'WRAPPER',\n 'WRITE',\n 'XML',\n 'XMLATTRIBUTES',\n 'XMLBINARY',\n 'XMLCAST',\n 'XMLDECLARATION',\n 'XMLDOCUMENT',\n 'XMLITERATE',\n 'XMLNAMESPACES',\n 'XMLQUERY',\n 'XMLSCHEMA',\n 'XMLTEXT',\n 'XMLVALIDATE',\n 'YEAR',\n 'YES',\n 'ZONE',\n];\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// https://www.postgresql.org/docs/14/sql-commands.html\nconst reservedCommands = [\n 'ABORT',\n 'ALTER AGGREGATE',\n 'ALTER COLLATION',\n 'ALTER CONVERSION',\n 'ALTER DATABASE',\n 'ALTER DEFAULT PRIVILEGES',\n 'ALTER DOMAIN',\n 'ALTER EVENT TRIGGER',\n 'ALTER EXTENSION',\n 'ALTER FOREIGN DATA WRAPPER',\n 'ALTER FOREIGN TABLE',\n 'ALTER FUNCTION',\n 'ALTER GROUP',\n 'ALTER INDEX',\n 'ALTER LANGUAGE',\n 'ALTER LARGE OBJECT',\n 'ALTER MATERIALIZED VIEW',\n 'ALTER OPERATOR',\n 'ALTER OPERATOR CLASS',\n 'ALTER OPERATOR FAMILY',\n 'ALTER POLICY',\n 'ALTER PROCEDURE',\n 'ALTER PUBLICATION',\n 'ALTER ROLE',\n 'ALTER ROUTINE',\n 'ALTER RULE',\n 'ALTER SCHEMA',\n 'ALTER SEQUENCE',\n 'ALTER SERVER',\n 'ALTER STATISTICS',\n 'ALTER SUBSCRIPTION',\n 'ALTER SYSTEM',\n 'ALTER TABLE',\n 'ALTER TABLESPACE',\n 'ALTER TEXT SEARCH CONFIGURATION',\n 'ALTER TEXT SEARCH DICTIONARY',\n 'ALTER TEXT SEARCH PARSER',\n 'ALTER TEXT SEARCH TEMPLATE',\n 'ALTER TRIGGER',\n 'ALTER TYPE',\n 'ALTER USER',\n 'ALTER USER MAPPING',\n 'ALTER VIEW',\n 'ANALYZE',\n 'BEGIN',\n 'CALL',\n 'CHECKPOINT',\n 'CLOSE',\n 'CLUSTER',\n 'COMMENT',\n 'COMMIT',\n 'COMMIT PREPARED',\n 'COPY',\n 'CREATE ACCESS METHOD',\n 'CREATE AGGREGATE',\n 'CREATE CAST',\n 'CREATE COLLATION',\n 'CREATE CONVERSION',\n 'CREATE DATABASE',\n 'CREATE DOMAIN',\n 'CREATE EVENT TRIGGER',\n 'CREATE EXTENSION',\n 'CREATE FOREIGN DATA WRAPPER',\n 'CREATE FOREIGN TABLE',\n 'CREATE FUNCTION',\n 'CREATE GROUP',\n 'CREATE INDEX',\n 'CREATE LANGUAGE',\n 'CREATE MATERIALIZED VIEW',\n 'CREATE OPERATOR',\n 'CREATE OPERATOR CLASS',\n 'CREATE OPERATOR FAMILY',\n 'CREATE POLICY',\n 'CREATE PROCEDURE',\n 'CREATE PUBLICATION',\n 'CREATE ROLE',\n 'CREATE RULE',\n 'CREATE SCHEMA',\n 'CREATE SEQUENCE',\n 'CREATE SERVER',\n 'CREATE STATISTICS',\n 'CREATE SUBSCRIPTION',\n 'CREATE TABLE',\n 'CREATE TABLE AS',\n 'CREATE TABLESPACE',\n 'CREATE TEXT SEARCH CONFIGURATION',\n 'CREATE TEXT SEARCH DICTIONARY',\n 'CREATE TEXT SEARCH PARSER',\n 'CREATE TEXT SEARCH TEMPLATE',\n 'CREATE TRANSFORM',\n 'CREATE TRIGGER',\n 'CREATE TYPE',\n 'CREATE USER',\n 'CREATE USER MAPPING',\n 'CREATE VIEW',\n 'DEALLOCATE',\n 'DECLARE',\n 'DELETE',\n 'DISCARD',\n 'DO',\n 'DROP ACCESS METHOD',\n 'DROP AGGREGATE',\n 'DROP CAST',\n 'DROP COLLATION',\n 'DROP CONVERSION',\n 'DROP DATABASE',\n 'DROP DOMAIN',\n 'DROP EVENT TRIGGER',\n 'DROP EXTENSION',\n 'DROP FOREIGN DATA WRAPPER',\n 'DROP FOREIGN TABLE',\n 'DROP FUNCTION',\n 'DROP GROUP',\n 'DROP INDEX',\n 'DROP LANGUAGE',\n 'DROP MATERIALIZED VIEW',\n 'DROP OPERATOR',\n 'DROP OPERATOR CLASS',\n 'DROP OPERATOR FAMILY',\n 'DROP OWNED',\n 'DROP POLICY',\n 'DROP PROCEDURE',\n 'DROP PUBLICATION',\n 'DROP ROLE',\n 'DROP ROUTINE',\n 'DROP RULE',\n 'DROP SCHEMA',\n 'DROP SEQUENCE',\n 'DROP SERVER',\n 'DROP STATISTICS',\n 'DROP SUBSCRIPTION',\n 'DROP TABLE',\n 'DROP TABLESPACE',\n 'DROP TEXT SEARCH CONFIGURATION',\n 'DROP TEXT SEARCH DICTIONARY',\n 'DROP TEXT SEARCH PARSER',\n 'DROP TEXT SEARCH TEMPLATE',\n 'DROP TRANSFORM',\n 'DROP TRIGGER',\n 'DROP TYPE',\n 'DROP USER',\n 'DROP USER MAPPING',\n 'DROP VIEW',\n 'END',\n 'EXECUTE',\n 'EXPLAIN',\n 'FETCH',\n 'GRANT',\n 'IMPORT FOREIGN SCHEMA',\n 'INSERT',\n 'LISTEN',\n 'LOAD',\n 'LOCK',\n 'MOVE',\n 'NOTIFY',\n 'PREPARE',\n 'PREPARE TRANSACTION',\n 'REASSIGN OWNED',\n 'REFRESH MATERIALIZED VIEW',\n 'REINDEX',\n 'RELEASE SAVEPOINT',\n 'RESET',\n 'RETURNING',\n 'REVOKE',\n 'ROLLBACK',\n 'ROLLBACK PREPARED',\n 'ROLLBACK TO SAVEPOINT',\n 'SAVEPOINT',\n 'SECURITY LABEL',\n 'SELECT',\n 'SELECT INTO',\n 'SET',\n 'SET CONSTRAINTS',\n 'SET ROLE',\n 'SET SESSION AUTHORIZATION',\n 'SET TRANSACTION',\n 'SHOW',\n 'START TRANSACTION',\n 'TRUNCATE',\n 'UNLISTEN',\n 'UPDATE',\n 'VACUUM',\n 'VALUES',\n // other\n 'ADD',\n 'AFTER',\n 'ALTER COLUMN',\n 'INSERT INTO', // verify\n 'SET SCHEMA', // verify\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'WHERE',\n 'WITH',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n 'MINUS',\n 'MINUS ALL',\n 'MINUS DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\nconst binaryOperators = [\n '<<',\n '>>',\n '||/',\n '|/',\n '::',\n ':=',\n '->>',\n '->',\n '=>',\n '~~*',\n '~~',\n '!~~*',\n '!~~',\n '~*',\n '!~*',\n '!~',\n '!!',\n '||',\n '@-@',\n '@@',\n '##',\n '<->',\n '&&',\n '&<',\n '&>',\n '<<|',\n '&<|',\n '|>>',\n '|&>',\n '<^',\n '^>',\n '?#',\n '?-',\n '?|',\n '?-|',\n '?||',\n '@>',\n '<@',\n '~=',\n '>>=',\n '<<=',\n '@@@',\n];\n\n// https://www.postgresql.org/docs/14/index.html\nexport default class PostgreSqlFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR'];\n static reservedKeywords = dedupe([\n ...Object.values(reservedFunctions).reduce((acc, arr) => [...acc, ...arr], []),\n ...reservedKeywords,\n ]);\n static stringTypes: StringPatternType[] = [`\"\"`, \"''\", \"U&''\", 'U&\"\"', '$$', '``', \"E''\"];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['$'];\n static namedPlaceholderTypes = [':'];\n static lineCommentTypes = ['--'];\n static operators = binaryOperators;\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: PostgreSqlFormatter.reservedCommands,\n reservedBinaryCommands: PostgreSqlFormatter.reservedBinaryCommands,\n reservedDependentClauses: PostgreSqlFormatter.reservedDependentClauses,\n reservedJoinConditions: PostgreSqlFormatter.reservedJoinConditions,\n reservedLogicalOperators: PostgreSqlFormatter.reservedLogicalOperators,\n reservedKeywords: PostgreSqlFormatter.reservedKeywords,\n stringTypes: PostgreSqlFormatter.stringTypes,\n blockStart: PostgreSqlFormatter.blockStart,\n blockEnd: PostgreSqlFormatter.blockEnd,\n indexedPlaceholderTypes: PostgreSqlFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: PostgreSqlFormatter.namedPlaceholderTypes,\n lineCommentTypes: PostgreSqlFormatter.lineCommentTypes,\n operators: PostgreSqlFormatter.operators,\n });\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\nconst reservedFunctions = {\n // https://docs.aws.amazon.com/redshift/latest/dg/c_Aggregate_Functions.html\n aggregate: [\n 'ANY_VALUE',\n 'APPROXIMATE PERCENTILE_DISC',\n 'AVG',\n 'COUNT',\n 'LISTAGG',\n 'MAX',\n 'MEDIAN',\n 'MIN',\n 'PERCENTILE_CONT',\n 'STDDEV_SAMP',\n 'STDDEV_POP',\n 'SUM',\n 'VAR_SAMP',\n 'VAR_POP',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/c_Array_Functions.html\n array: [\n 'array',\n 'array_concat',\n 'array_flatten',\n 'get_array_length',\n 'split_to_array',\n 'subarray',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/c_bitwise_aggregate_functions.html\n bitwise: ['BIT_AND', 'BIT_OR', 'BOOL_AND', 'BOOL_OR'],\n // https://docs.aws.amazon.com/redshift/latest/dg/c_conditional_expressions.html\n conditional: ['CASE', 'COALESCE', 'DECODE', 'GREATEST', 'LEAST', 'NVL', 'NVL2', 'NULLIF'],\n // https://docs.aws.amazon.com/redshift/latest/dg/Date_functions_header.html\n dateTime: [\n 'ADD_MONTHS',\n 'AT TIME ZONE',\n 'CONVERT_TIMEZONE',\n 'CURRENT_DATE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'DATE_CMP',\n 'DATE_CMP_TIMESTAMP',\n 'DATE_CMP_TIMESTAMPTZ',\n 'DATE_PART_YEAR',\n 'DATEADD',\n 'DATEDIFF',\n 'DATE_PART',\n 'DATE_TRUNC',\n 'EXTRACT',\n 'GETDATE',\n 'INTERVAL_CMP',\n 'LAST_DAY',\n 'MONTHS_BETWEEN',\n 'NEXT_DAY',\n 'SYSDATE',\n 'TIMEOFDAY',\n 'TIMESTAMP_CMP',\n 'TIMESTAMP_CMP_DATE',\n 'TIMESTAMP_CMP_TIMESTAMPTZ',\n 'TIMESTAMPTZ_CMP',\n 'TIMESTAMPTZ_CMP_DATE',\n 'TIMESTAMPTZ_CMP_TIMESTAMP',\n 'TIMEZONE',\n 'TO_TIMESTAMP',\n 'TRUNC',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/geospatial-functions.html\n spatial: [\n 'AddBBox',\n 'DropBBox',\n 'GeometryType',\n 'ST_AddPoint',\n 'ST_Angle',\n 'ST_Area',\n 'ST_AsBinary',\n 'ST_AsEWKB',\n 'ST_AsEWKT',\n 'ST_AsGeoJSON',\n 'ST_AsText',\n 'ST_Azimuth',\n 'ST_Boundary',\n 'ST_Collect',\n 'ST_Contains',\n 'ST_ContainsProperly',\n 'ST_ConvexHull',\n 'ST_CoveredBy',\n 'ST_Covers',\n 'ST_Crosses',\n 'ST_Dimension',\n 'ST_Disjoint',\n 'ST_Distance',\n 'ST_DistanceSphere',\n 'ST_DWithin',\n 'ST_EndPoint',\n 'ST_Envelope',\n 'ST_Equals',\n 'ST_ExteriorRing',\n 'ST_Force2D',\n 'ST_Force3D',\n 'ST_Force3DM',\n 'ST_Force3DZ',\n 'ST_Force4D',\n 'ST_GeometryN',\n 'ST_GeometryType',\n 'ST_GeomFromEWKB',\n 'ST_GeomFromEWKT',\n 'ST_GeomFromText',\n 'ST_GeomFromWKB',\n 'ST_InteriorRingN',\n 'ST_Intersects',\n 'ST_IsPolygonCCW',\n 'ST_IsPolygonCW',\n 'ST_IsClosed',\n 'ST_IsCollection',\n 'ST_IsEmpty',\n 'ST_IsSimple',\n 'ST_IsValid',\n 'ST_Length',\n 'ST_LengthSphere',\n 'ST_Length2D',\n 'ST_LineFromMultiPoint',\n 'ST_LineInterpolatePoint',\n 'ST_M',\n 'ST_MakeEnvelope',\n 'ST_MakeLine',\n 'ST_MakePoint',\n 'ST_MakePolygon',\n 'ST_MemSize',\n 'ST_MMax',\n 'ST_MMin',\n 'ST_Multi',\n 'ST_NDims',\n 'ST_NPoints',\n 'ST_NRings',\n 'ST_NumGeometries',\n 'ST_NumInteriorRings',\n 'ST_NumPoints',\n 'ST_Perimeter',\n 'ST_Perimeter2D',\n 'ST_Point',\n 'ST_PointN',\n 'ST_Points',\n 'ST_Polygon',\n 'ST_RemovePoint',\n 'ST_Reverse',\n 'ST_SetPoint',\n 'ST_SetSRID',\n 'ST_Simplify',\n 'ST_SRID',\n 'ST_StartPoint',\n 'ST_Touches',\n 'ST_Within',\n 'ST_X',\n 'ST_XMax',\n 'ST_XMin',\n 'ST_Y',\n 'ST_YMax',\n 'ST_YMin',\n 'ST_Z',\n 'ST_ZMax',\n 'ST_ZMin',\n 'SupportsBBox',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/hash-functions.html\n hash: ['CHECKSUM', 'FUNC_SHA1', 'FNV_HASH', 'MD5', 'SHA', 'SHA1', 'SHA2'],\n // https://docs.aws.amazon.com/redshift/latest/dg/hyperloglog-functions.html\n hyperLogLog: ['HLL', 'HLL_CREATE_SKETCH', 'HLL_CARDINALITY', 'HLL_COMBINE'],\n // https://docs.aws.amazon.com/redshift/latest/dg/json-functions.html\n json: [\n 'IS_VALID_JSON',\n 'IS_VALID_JSON_ARRAY',\n 'JSON_ARRAY_LENGTH',\n 'JSON_EXTRACT_ARRAY_ELEMENT_TEXT',\n 'JSON_EXTRACT_PATH_TEXT',\n 'JSON_PARSE',\n 'JSON_SERIALIZE',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/Math_functions.html\n math: [\n 'ABS',\n 'ACOS',\n 'ASIN',\n 'ATAN',\n 'ATAN2',\n 'CBRT',\n 'CEILING',\n 'CEIL',\n 'COS',\n 'COT',\n 'DEGREES',\n 'DEXP',\n 'DLOG1',\n 'DLOG10',\n 'EXP',\n 'FLOOR',\n 'LN',\n 'LOG',\n 'MOD',\n 'PI',\n 'POWER',\n 'RADIANS',\n 'RANDOM',\n 'ROUND',\n 'SIN',\n 'SIGN',\n 'SQRT',\n 'TAN',\n 'TO_HEX',\n 'TRUNC',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/ml-function.html\n machineLearning: ['EXPLAIN_MODEL'],\n // https://docs.aws.amazon.com/redshift/latest/dg/String_functions_header.html\n string: [\n 'ASCII',\n 'BPCHARCMP',\n 'BTRIM',\n 'BTTEXT_PATTERN_CMP',\n 'CHAR_LENGTH',\n 'CHARACTER_LENGTH',\n 'CHARINDEX',\n 'CHR',\n 'COLLATE',\n 'CONCAT',\n 'CRC32',\n 'DIFFERENCE',\n 'INITCAP',\n 'LEFT',\n 'RIGHT',\n 'LEN',\n 'LENGTH',\n 'LOWER',\n 'LPAD',\n 'RPAD',\n 'LTRIM',\n 'OCTETINDEX',\n 'OCTET_LENGTH',\n 'POSITION',\n 'QUOTE_IDENT',\n 'QUOTE_LITERAL',\n 'REGEXP_COUNT',\n 'REGEXP_INSTR',\n 'REGEXP_REPLACE',\n 'REGEXP_SUBSTR',\n 'REPEAT',\n 'REPLACE',\n 'REPLICATE',\n 'REVERSE',\n 'RTRIM',\n 'SOUNDEX',\n 'SPLIT_PART',\n 'STRPOS',\n 'STRTOL',\n 'SUBSTRING',\n 'TEXTLEN',\n 'TRANSLATE',\n 'TRIM',\n 'UPPER',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/c_Type_Info_Functions.html\n superType: [\n 'decimal_precision',\n 'decimal_scale',\n 'is_array',\n 'is_bigint',\n 'is_boolean',\n 'is_char',\n 'is_decimal',\n 'is_float',\n 'is_integer',\n 'is_object',\n 'is_scalar',\n 'is_smallint',\n 'is_varchar',\n 'json_typeof',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/c_Window_functions.html\n window: [\n 'AVG',\n 'COUNT',\n 'CUME_DIST',\n 'DENSE_RANK',\n 'FIRST_VALUE',\n 'LAST_VALUE',\n 'LAG',\n 'LEAD',\n 'LISTAGG',\n 'MAX',\n 'MEDIAN',\n 'MIN',\n 'NTH_VALUE',\n 'NTILE',\n 'PERCENT_RANK',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'RANK',\n 'RATIO_TO_REPORT',\n 'ROW_NUMBER',\n 'STDDEV_SAMP',\n 'STDDEV_POP',\n 'SUM',\n 'VAR_SAMP',\n 'VAR_POP',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/r_Data_type_formatting.html\n dataType: [\n 'CAST',\n 'CONVERT',\n 'TO_CHAR',\n 'TO_DATE',\n 'TO_NUMBER',\n 'TEXT_TO_INT_ALT',\n 'TEXT_TO_NUMERIC_ALT',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/r_System_administration_functions.html\n sysAdmin: [\n 'CHANGE_QUERY_PRIORITY',\n 'CHANGE_SESSION_PRIORITY',\n 'CHANGE_USER_PRIORITY',\n 'CURRENT_SETTING',\n 'PG_CANCEL_BACKEND',\n 'PG_TERMINATE_BACKEND',\n 'REBOOT_CLUSTER',\n 'SET_CONFIG',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/r_System_information_functions.html\n sysInfo: [\n 'CURRENT_AWS_ACCOUNT',\n 'CURRENT_DATABASE',\n 'CURRENT_NAMESPACE',\n 'CURRENT_SCHEMA',\n 'CURRENT_SCHEMAS',\n 'CURRENT_USER',\n 'CURRENT_USER_ID',\n 'HAS_ASSUMEROLE_PRIVILEGE',\n 'HAS_DATABASE_PRIVILEGE',\n 'HAS_SCHEMA_PRIVILEGE',\n 'HAS_TABLE_PRIVILEGE',\n 'PG_BACKEND_PID',\n 'PG_GET_COLS',\n 'PG_GET_GRANTEE_BY_IAM_ROLE',\n 'PG_GET_IAM_ROLE_BY_USER',\n 'PG_GET_LATE_BINDING_VIEW_COLS',\n 'PG_LAST_COPY_COUNT',\n 'PG_LAST_COPY_ID',\n 'PG_LAST_UNLOAD_ID',\n 'PG_LAST_QUERY_ID',\n 'PG_LAST_UNLOAD_COUNT',\n 'SESSION_USER',\n 'SLICE_NUM',\n 'USER',\n 'VERSION',\n ],\n};\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\nconst reservedKeywords = {\n // https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html\n standard: [\n 'AES128',\n 'AES256',\n 'ALL',\n 'ALLOWOVERWRITE',\n 'ANY',\n 'ARRAY',\n 'AS',\n 'ASC',\n 'AUTHORIZATION',\n 'BACKUP',\n 'BETWEEN',\n 'BINARY',\n 'BOTH',\n 'CHECK',\n 'COLUMN',\n 'CONSTRAINT',\n 'CREATE',\n 'CROSS',\n 'DEFAULT',\n 'DEFERRABLE',\n 'DEFLATE',\n 'DEFRAG',\n 'DESC',\n 'DISABLE',\n 'DISTINCT',\n 'DO',\n 'ENABLE',\n 'ENCODE',\n 'ENCRYPT',\n 'ENCRYPTION',\n 'EXPLICIT',\n 'FALSE',\n 'FOR',\n 'FOREIGN',\n 'FREEZE',\n 'FROM',\n 'FULL',\n 'GLOBALDICT256',\n 'GLOBALDICT64K',\n 'GROUP',\n 'IDENTITY',\n 'IGNORE',\n 'ILIKE',\n 'IN',\n 'INITIALLY',\n 'INNER',\n 'INTO',\n 'IS',\n 'ISNULL',\n 'LANGUAGE',\n 'LEADING',\n 'LIKE',\n 'LIMIT',\n 'LOCALTIME',\n 'LOCALTIMESTAMP',\n 'LUN',\n 'LUNS',\n 'MINUS',\n 'NATURAL',\n 'NEW',\n 'NOT',\n 'NOTNULL',\n 'NULL',\n 'NULLS',\n 'OFF',\n 'OFFLINE',\n 'OFFSET',\n 'OID',\n 'OLD',\n 'ONLY',\n 'OPEN',\n 'ORDER',\n 'OUTER',\n 'OVERLAPS',\n 'PARALLEL',\n 'PARTITION',\n 'PERCENT',\n 'PERMISSIONS',\n 'PLACING',\n 'PRIMARY',\n 'RECOVER',\n 'REFERENCES',\n 'REJECTLOG',\n 'RESORT',\n 'RESPECT',\n 'RESTORE',\n 'SIMILAR',\n 'SNAPSHOT',\n 'SOME',\n 'SYSTEM',\n 'TABLE',\n 'TAG',\n 'TDES',\n 'THEN',\n 'TIMESTAMP',\n 'TO',\n 'TOP',\n 'TRAILING',\n 'TRUE',\n 'UNIQUE',\n 'VERBOSE',\n 'WALLET',\n 'WITHOUT',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-conversion.html\n dataConversionParams: [\n 'ACCEPTANYDATE',\n 'ACCEPTINVCHARS',\n 'BLANKSASNULL',\n 'DATEFORMAT',\n 'EMPTYASNULL',\n 'ENCODING',\n 'ESCAPE',\n 'EXPLICIT_IDS',\n 'FILLRECORD',\n 'IGNOREBLANKLINES',\n 'IGNOREHEADER',\n 'NULL AS',\n 'REMOVEQUOTES',\n 'ROUNDEC',\n 'TIMEFORMAT',\n 'TRIMBLANKS',\n 'TRUNCATECOLUMNS',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-load.html\n dataLoadParams: ['COMPROWS', 'COMPUPDATE', 'MAXERROR', 'NOLOAD', 'STATUPDATE'],\n // https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-format.html\n dataFormatParams: [\n 'FORMAT',\n 'CSV',\n 'DELIMITER',\n 'FIXEDWIDTH',\n 'SHAPEFILE',\n 'AVRO',\n 'JSON',\n 'PARQUET',\n 'ORC',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-authorization.html\n copyAuthParams: [\n 'ACCESS_KEY_ID',\n 'CREDENTIALS',\n 'ENCRYPTED',\n 'IAM_ROLE',\n 'MASTER_SYMMETRIC_KEY',\n 'SECRET_ACCESS_KEY',\n 'SESSION_TOKEN',\n ],\n // https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-file-compression.html\n copyCompressionParams: ['BZIP2', 'GZIP', 'LZOP', 'ZSTD'],\n // https://docs.aws.amazon.com/redshift/latest/dg/r_COPY-alphabetical-parm-list.html\n copyMiscParams: ['MANIFEST', 'READRATIO', 'REGION', 'SSH'],\n // https://docs.aws.amazon.com/redshift/latest/dg/c_Compression_encodings.html\n compressionEncodings: [\n 'RAW',\n 'AZ64',\n 'BYTEDICT',\n 'DELTA',\n 'DELTA32K',\n 'LZO',\n 'MOSTLY8',\n 'MOSTLY16',\n 'MOSTLY32',\n 'RUNLENGTH',\n 'TEXT255',\n 'TEXT32K',\n ],\n misc: [\n // CREATE EXTERNAL SCHEMA (https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_SCHEMA.html)\n 'CATALOG_ROLE',\n 'SECRET_ARN',\n 'EXTERNAL',\n 'HIVE METASTORE', // https://docs.aws.amazon.com/redshift/latest/dg/c-spectrum-external-schemas.html\n // https://docs.aws.amazon.com/redshift/latest/dg/c_choosing_dist_sort.html\n 'AUTO',\n 'EVEN',\n 'KEY',\n 'PREDICATE', // ANALYZE | ANALYSE (https://docs.aws.amazon.com/redshift/latest/dg/r_ANALYZE.html)\n // unknown\n 'COMPRESSION',\n 'DATA CATALOG',\n ],\n /**\n * Other keywords not included:\n * STL: https://docs.aws.amazon.com/redshift/latest/dg/c_intro_STL_tables.html\n * SVCS: https://docs.aws.amazon.com/redshift/latest/dg/svcs_views.html\n * SVL: https://docs.aws.amazon.com/redshift/latest/dg/svl_views.html\n * SVV: https://docs.aws.amazon.com/redshift/latest/dg/svv_views.html\n */\n dataTypes: [\n 'CHAR',\n 'CHARACTER',\n 'NCHAR',\n 'VARCHAR',\n 'CHARACTER VARYING',\n 'NVARCHAR',\n 'BPCHAR',\n 'TEXT',\n ],\n};\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_commands.html\nconst reservedCommands = [\n 'ABORT',\n 'ALTER DATABASE',\n 'ALTER DATASHARE',\n 'ALTER DEFAULT PRIVILEGES',\n 'ALTER GROUP',\n 'ALTER MATERIALIZED VIEW',\n 'ALTER PROCEDURE',\n 'ALTER SCHEMA',\n 'ALTER TABLE',\n 'ALTER TABLE APPEND',\n 'ALTER USER',\n 'ANALYSE',\n 'ANALYZE',\n 'ANALYSE COMPRESSION',\n 'ANALYZE COMPRESSION',\n 'BEGIN',\n 'CALL',\n 'CANCEL',\n 'CLOSE',\n 'COMMENT',\n 'COMMIT',\n 'COPY',\n 'CREATE DATABASE',\n 'CREATE DATASHARE',\n 'CREATE EXTERNAL FUNCTION',\n 'CREATE EXTERNAL SCHEMA',\n 'CREATE EXTERNAL TABLE',\n 'CREATE FUNCTION',\n 'CREATE GROUP',\n 'CREATE LIBRARY',\n 'CREATE MATERIALIZED VIEW',\n 'CREATE MODEL',\n 'CREATE PROCEDURE',\n 'CREATE SCHEMA',\n 'CREATE TABLE',\n 'CREATE TABLE AS',\n 'CREATE USER',\n 'CREATE VIEW',\n 'DEALLOCATE',\n 'DECLARE',\n 'DELETE',\n 'DESC DATASHARE',\n 'DROP DATABASE',\n 'DROP DATASHARE',\n 'DROP FUNCTION',\n 'DROP GROUP',\n 'DROP LIBRARY',\n 'DROP MODEL',\n 'DROP MATERIALIZED VIEW',\n 'DROP PROCEDURE',\n 'DROP SCHEMA',\n 'DROP TABLE',\n 'DROP USER',\n 'DROP VIEW',\n 'DROP',\n 'END',\n 'EXECUTE',\n 'EXPLAIN',\n 'FETCH',\n 'FROM',\n 'GRANT',\n 'HAVING',\n 'INSERT',\n 'LOCK',\n 'PREPARE',\n 'REFRESH MATERIALIZED VIEW',\n 'RESET',\n 'REVOKE',\n 'ROLLBACK',\n 'SELECT',\n 'SELECT INTO',\n 'SET',\n 'SET SESSION AUTHORIZATION',\n 'SET SESSION CHARACTERISTICS',\n 'SHOW',\n 'SHOW EXTERNAL TABLE',\n 'SHOW MODEL',\n 'SHOW DATASHARES',\n 'SHOW PROCEDURE',\n 'SHOW TABLE',\n 'SHOW VIEW',\n 'START TRANSACTION',\n 'TRUNCATE',\n 'UNLOAD',\n 'UPDATE',\n 'VACUUM',\n 'WHERE',\n 'WITH',\n // other\n 'GROUP BY',\n 'ORDER BY',\n 'LIMIT',\n 'OFFSET',\n 'VALUES',\n 'MODIFY', // verify\n 'INSERT INTO', // verify\n 'ALTER COLUMN', // verify\n 'SET SCHEMA', // verify\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\n// https://docs.aws.amazon.com/redshift/latest/dg/cm_chap_SQLCommandRef.html\nexport default class RedshiftFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR'];\n static reservedKeywords = dedupe([\n ...Object.values(reservedFunctions).reduce((acc, arr) => [...acc, ...arr], []),\n ...Object.values(reservedKeywords).reduce((acc, arr) => [...acc, ...arr], []),\n ]);\n static stringTypes: StringPatternType[] = [`\"\"`, \"''\", '``'];\n static blockStart = ['('];\n static blockEnd = [')'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = ['@', '#', '$'];\n static lineCommentTypes = ['--'];\n static operators = ['|/', '||/', '<<', '>>', '||'];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: RedshiftFormatter.reservedCommands,\n reservedBinaryCommands: RedshiftFormatter.reservedBinaryCommands,\n reservedDependentClauses: RedshiftFormatter.reservedDependentClauses,\n reservedJoinConditions: RedshiftFormatter.reservedJoinConditions,\n reservedLogicalOperators: RedshiftFormatter.reservedLogicalOperators,\n reservedKeywords: RedshiftFormatter.reservedKeywords,\n stringTypes: RedshiftFormatter.stringTypes,\n blockStart: RedshiftFormatter.blockStart,\n blockEnd: RedshiftFormatter.blockEnd,\n indexedPlaceholderTypes: RedshiftFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: RedshiftFormatter.namedPlaceholderTypes,\n lineCommentTypes: RedshiftFormatter.lineCommentTypes,\n operators: RedshiftFormatter.operators,\n });\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport { isToken, Token, TokenType } from '../core/token'; // convert to partial type import in TS 4.5\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\n// http://spark.apache.org/docs/latest/sql-ref-functions.html\nconst reservedFunctions = {\n // http://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#aggregate-functions\n aggregate: [\n 'ANY',\n 'APPROX_COUNT_DISTINCT',\n 'APPROX_PERCENTILE',\n 'AVG',\n 'BIT_AND',\n 'BIT_OR',\n 'BIT_XOR',\n 'BOOL_AND',\n 'BOOL_OR',\n 'COLLECT_LIST',\n 'COLLECT_SET',\n 'CORR',\n 'COUNT',\n 'COUNT',\n 'COUNT',\n 'COUNT_IF',\n 'COUNT_MIN_SKETCH',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'EVERY',\n 'FIRST',\n 'FIRST_VALUE',\n 'GROUPING',\n 'GROUPING_ID',\n 'KURTOSIS',\n 'LAST',\n 'LAST_VALUE',\n 'MAX',\n 'MAX_BY',\n 'MEAN',\n 'MIN',\n 'MIN_BY',\n 'PERCENTILE',\n 'PERCENTILE',\n 'PERCENTILE_APPROX',\n 'SKEWNESS',\n 'SOME',\n 'STD',\n 'STDDEV',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'SUM',\n 'VAR_POP',\n 'VAR_SAMP',\n 'VARIANCE',\n ],\n // http://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#window-functions\n window: [\n 'CUME_DIST',\n 'DENSE_RANK',\n 'LAG',\n 'LEAD',\n 'NTH_VALUE',\n 'NTILE',\n 'PERCENT_RANK',\n 'RANK',\n 'ROW_NUMBER',\n ],\n // http://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#array-functions\n array: [\n 'ARRAY',\n 'ARRAY_CONTAINS',\n 'ARRAY_DISTINCT',\n 'ARRAY_EXCEPT',\n 'ARRAY_INTERSECT',\n 'ARRAY_JOIN',\n 'ARRAY_MAX',\n 'ARRAY_MIN',\n 'ARRAY_POSITION',\n 'ARRAY_REMOVE',\n 'ARRAY_REPEAT',\n 'ARRAY_UNION',\n 'ARRAYS_OVERLAP',\n 'ARRAYS_ZIP',\n 'FLATTEN',\n 'SEQUENCE',\n 'SHUFFLE',\n 'SLICE',\n 'SORT_ARRAY',\n ],\n // http://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#map-functions\n map: [\n 'ELEMENT_AT',\n 'ELEMENT_AT',\n 'MAP',\n 'MAP_CONCAT',\n 'MAP_ENTRIES',\n 'MAP_FROM_ARRAYS',\n 'MAP_FROM_ENTRIES',\n 'MAP_KEYS',\n 'MAP_VALUES',\n 'STR_TO_MAP',\n ],\n // http://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#date-and-timestamp-functions\n datetime: [\n 'ADD_MONTHS',\n 'CURRENT_DATE',\n 'CURRENT_DATE',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_TIMEZONE',\n 'DATE_ADD',\n 'DATE_FORMAT',\n 'DATE_FROM_UNIX_DATE',\n 'DATE_PART',\n 'DATE_SUB',\n 'DATE_TRUNC',\n 'DATEDIFF',\n 'DAY',\n 'DAYOFMONTH',\n 'DAYOFWEEK',\n 'DAYOFYEAR',\n 'EXTRACT',\n 'FROM_UNIXTIME',\n 'FROM_UTC_TIMESTAMP',\n 'HOUR',\n 'LAST_DAY',\n 'MAKE_DATE',\n 'MAKE_DT_INTERVAL',\n 'MAKE_INTERVAL',\n 'MAKE_TIMESTAMP',\n 'MAKE_YM_INTERVAL',\n 'MINUTE',\n 'MONTH',\n 'MONTHS_BETWEEN',\n 'NEXT_DAY',\n 'NOW',\n 'QUARTER',\n 'SECOND',\n 'SESSION_WINDOW',\n 'TIMESTAMP_MICROS',\n 'TIMESTAMP_MILLIS',\n 'TIMESTAMP_SECONDS',\n 'TO_DATE',\n 'TO_TIMESTAMP',\n 'TO_UNIX_TIMESTAMP',\n 'TO_UTC_TIMESTAMP',\n 'TRUNC',\n 'UNIX_DATE',\n 'UNIX_MICROS',\n 'UNIX_MILLIS',\n 'UNIX_SECONDS',\n 'UNIX_TIMESTAMP',\n 'WEEKDAY',\n 'WEEKOFYEAR',\n 'WINDOW',\n 'YEAR',\n ],\n // http://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#json-functions\n json: [\n 'FROM_JSON',\n 'GET_JSON_OBJECT',\n 'JSON_ARRAY_LENGTH',\n 'JSON_OBJECT_KEYS',\n 'JSON_TUPLE',\n 'SCHEMA_OF_JSON',\n 'TO_JSON',\n ],\n // http://spark.apache.org/docs/latest/api/sql/index.html\n misc: [\n 'ABS',\n 'ACOS',\n 'ACOSH',\n 'AGGREGATE',\n 'ARRAY_SORT',\n 'ASCII',\n 'ASIN',\n 'ASINH',\n 'ASSERT_TRUE',\n 'ATAN',\n 'ATAN2',\n 'ATANH',\n 'BASE64',\n 'BIGINT',\n 'BIN',\n 'BINARY',\n 'BIT_COUNT',\n 'BIT_GET',\n 'BIT_LENGTH',\n 'BOOLEAN',\n 'BROUND',\n 'BTRIM',\n 'CARDINALITY',\n 'CBRT',\n 'CEIL',\n 'CEILING',\n 'CHAR',\n 'CHAR_LENGTH',\n 'CHARACTER_LENGTH',\n 'CHR',\n 'CONCAT',\n 'CONCAT_WS',\n 'CONV',\n 'COS',\n 'COSH',\n 'COT',\n 'CRC32',\n 'CURRENT_CATALOG',\n 'CURRENT_DATABASE',\n 'CURRENT_USER',\n 'DATE',\n 'DECIMAL',\n 'DEGREES',\n 'DOUBLE',\n // 'E',\n 'ELT',\n 'EXP',\n 'EXPM1',\n 'FACTORIAL',\n 'FIND_IN_SET',\n 'FLOAT',\n 'FLOOR',\n 'FORALL',\n 'FORMAT_NUMBER',\n 'FORMAT_STRING',\n 'FROM_CSV',\n 'GETBIT',\n 'HASH',\n 'HEX',\n 'HYPOT',\n 'INITCAP',\n 'INLINE',\n 'INLINE_OUTER',\n 'INPUT_FILE_BLOCK_LENGTH',\n 'INPUT_FILE_BLOCK_START',\n 'INPUT_FILE_NAME',\n 'INSTR',\n 'INT',\n 'ISNAN',\n 'ISNOTNULL',\n 'ISNULL',\n 'JAVA_METHOD',\n 'LCASE',\n 'LEFT',\n 'LENGTH',\n 'LEVENSHTEIN',\n 'LN',\n 'LOCATE',\n 'LOG',\n 'LOG10',\n 'LOG1P',\n 'LOG2',\n 'LOWER',\n 'LPAD',\n 'LTRIM',\n 'MAP_FILTER',\n 'MAP_ZIP_WITH',\n 'MD5',\n 'MOD',\n 'MONOTONICALLY_INCREASING_ID',\n 'NAMED_STRUCT',\n 'NANVL',\n 'NEGATIVE',\n 'NVL',\n 'NVL2',\n 'OCTET_LENGTH',\n 'OVERLAY',\n 'PARSE_URL',\n 'PI',\n 'PMOD',\n 'POSEXPLODE',\n 'POSEXPLODE_OUTER',\n 'POSITION',\n 'POSITIVE',\n 'POW',\n 'POWER',\n 'PRINTF',\n 'RADIANS',\n 'RAISE_ERROR',\n 'RAND',\n 'RANDN',\n 'RANDOM',\n 'REFLECT',\n 'REGEXP_EXTRACT',\n 'REGEXP_EXTRACT_ALL',\n 'REGEXP_LIKE',\n 'REGEXP_REPLACE',\n 'REPEAT',\n 'REPLACE',\n 'REVERSE',\n 'RIGHT',\n 'RINT',\n 'ROUND',\n 'RPAD',\n 'RTRIM',\n 'SCHEMA_OF_CSV',\n 'SENTENCES',\n 'SHA',\n 'SHA1',\n 'SHA2',\n 'SHIFTLEFT',\n 'SHIFTRIGHT',\n 'SHIFTRIGHTUNSIGNED',\n 'SIGN',\n 'SIGNUM',\n 'SIN',\n 'SINH',\n 'SMALLINT',\n 'SOUNDEX',\n 'SPACE',\n 'SPARK_PARTITION_ID',\n 'SPLIT',\n 'SQRT',\n 'STACK',\n 'SUBSTR',\n 'SUBSTRING',\n 'SUBSTRING_INDEX',\n 'TAN',\n 'TANH',\n 'TIMESTAMP',\n 'TINYINT',\n 'TO_CSV',\n 'TRANSFORM_KEYS',\n 'TRANSFORM_VALUES',\n 'TRANSLATE',\n 'TRIM',\n 'TRY_ADD',\n 'TRY_DIVIDE',\n 'TYPEOF',\n 'UCASE',\n 'UNBASE64',\n 'UNHEX',\n 'UPPER',\n 'UUID',\n 'VERSION',\n 'WIDTH_BUCKET',\n 'XPATH',\n 'XPATH_BOOLEAN',\n 'XPATH_DOUBLE',\n 'XPATH_FLOAT',\n 'XPATH_INT',\n 'XPATH_LONG',\n 'XPATH_NUMBER',\n 'XPATH_SHORT',\n 'XPATH_STRING',\n 'XXHASH64',\n 'ZIP_WITH',\n ],\n};\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\n// https://deepkb.com/CO_000013/en/kb/IMPORT-fbfa59f0-2bf1-31fe-bb7b-0f9efe9932c6/spark-sql-keywords\nconst reservedKeywords = [\n 'ADD',\n 'AFTER',\n 'ALL',\n 'ALTER',\n 'ANALYZE',\n 'AND',\n 'ANTI',\n 'ANY',\n 'ARCHIVE',\n 'ARRAY',\n 'AS',\n 'ASC',\n 'AT',\n 'AUTHORIZATION',\n 'BETWEEN',\n 'BOTH',\n 'BUCKET',\n 'BUCKETS',\n 'BY',\n 'CACHE',\n 'CASCADE',\n 'CAST',\n 'CHANGE',\n 'CHECK',\n 'CLEAR',\n 'CLUSTER',\n 'CLUSTERED',\n 'CODEGEN',\n 'COLLATE',\n 'COLLECTION',\n 'COLUMN',\n 'COLUMNS',\n 'COMMENT',\n 'COMMIT',\n 'COMPACT',\n 'COMPACTIONS',\n 'COMPUTE',\n 'CONCATENATE',\n 'CONSTRAINT',\n 'COST',\n 'CREATE',\n 'CROSS',\n 'CUBE',\n 'CURRENT',\n 'CURRENT_DATE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_USER',\n 'DATA',\n 'DATABASE',\n 'DATABASES',\n 'DAY',\n 'DBPROPERTIES',\n 'DEFINED',\n 'DELETE',\n 'DELIMITED',\n 'DESC',\n 'DESCRIBE',\n 'DFS',\n 'DIRECTORIES',\n 'DIRECTORY',\n 'DISTINCT',\n 'DISTRIBUTE',\n 'DIV',\n 'DROP',\n 'ESCAPE',\n 'ESCAPED',\n 'EXCEPT',\n 'EXCHANGE',\n 'EXISTS',\n 'EXPORT',\n 'EXTENDED',\n 'EXTERNAL',\n 'EXTRACT',\n 'FALSE',\n 'FETCH',\n 'FIELDS',\n 'FILTER',\n 'FILEFORMAT',\n 'FIRST',\n 'FIRST_VALUE',\n 'FOLLOWING',\n 'FOR',\n 'FOREIGN',\n 'FORMAT',\n 'FORMATTED',\n 'FULL',\n 'FUNCTION',\n 'FUNCTIONS',\n 'GLOBAL',\n 'GRANT',\n 'GROUP',\n 'GROUPING',\n 'HOUR',\n 'IF',\n 'IGNORE',\n 'IMPORT',\n 'IN',\n 'INDEX',\n 'INDEXES',\n 'INNER',\n 'INPATH',\n 'INPUTFORMAT',\n 'INTERSECT',\n 'INTERVAL',\n 'INTO',\n 'IS',\n 'ITEMS',\n 'KEYS',\n 'LAST',\n 'LAST_VALUE',\n 'LATERAL',\n 'LAZY',\n 'LEADING',\n 'LEFT',\n 'LIKE',\n 'LINES',\n 'LIST',\n 'LOCAL',\n 'LOCATION',\n 'LOCK',\n 'LOCKS',\n 'LOGICAL',\n 'MACRO',\n 'MAP',\n 'MATCHED',\n 'MERGE',\n 'MINUTE',\n 'MONTH',\n 'MSCK',\n 'NAMESPACE',\n 'NAMESPACES',\n 'NATURAL',\n 'NO',\n 'NOT',\n 'NULL',\n 'NULLS',\n 'OF',\n 'ONLY',\n 'OPTION',\n 'OPTIONS',\n 'OR',\n 'ORDER',\n 'OUT',\n 'OUTER',\n 'OUTPUTFORMAT',\n 'OVER',\n 'OVERLAPS',\n 'OVERLAY',\n 'OVERWRITE',\n 'OWNER',\n 'PARTITION',\n 'PARTITIONED',\n 'PARTITIONS',\n 'PERCENT',\n 'PLACING',\n 'POSITION',\n 'PRECEDING',\n 'PRIMARY',\n 'PRINCIPALS',\n 'PROPERTIES',\n 'PURGE',\n 'QUERY',\n 'RANGE',\n 'RECORDREADER',\n 'RECORDWRITER',\n 'RECOVER',\n 'REDUCE',\n 'REFERENCES',\n 'RENAME',\n 'REPAIR',\n 'REPLACE',\n 'RESPECT',\n 'RESTRICT',\n 'REVOKE',\n 'RIGHT',\n 'RLIKE',\n 'ROLE',\n 'ROLES',\n 'ROLLBACK',\n 'ROLLUP',\n 'ROW',\n 'ROWS',\n 'SCHEMA',\n 'SECOND',\n 'SELECT',\n 'SEMI',\n 'SEPARATED',\n 'SERDE',\n 'SERDEPROPERTIES',\n 'SESSION_USER',\n 'SETS',\n 'SHOW',\n 'SKEWED',\n 'SOME',\n 'SORT',\n 'SORTED',\n 'START',\n 'STATISTICS',\n 'STORED',\n 'STRATIFY',\n 'STRUCT',\n 'SUBSTR',\n 'SUBSTRING',\n 'TABLE',\n 'TABLES',\n 'TBLPROPERTIES',\n 'TEMPORARY',\n 'TERMINATED',\n 'THEN',\n 'TO',\n 'TOUCH',\n 'TRAILING',\n 'TRANSACTION',\n 'TRANSACTIONS',\n 'TRIM',\n 'TRUE',\n 'TRUNCATE',\n 'UNARCHIVE',\n 'UNBOUNDED',\n 'UNCACHE',\n 'UNIQUE',\n 'UNKNOWN',\n 'UNLOCK',\n 'UNSET',\n 'USE',\n 'USER',\n 'VIEW',\n 'WINDOW',\n 'YEAR',\n // other\n 'ANALYSE',\n 'ARRAY_ZIP',\n 'COALESCE',\n 'CONTAINS',\n 'CONVERT',\n 'CURRENT ROW',\n 'DAYS',\n 'DAY_HOUR',\n 'DAY_MINUTE',\n 'DAY_SECOND',\n 'DECODE',\n 'DEFAULT',\n 'DISTINCTROW',\n 'ENCODE',\n 'EXPLODE',\n 'EXPLODE_OUTER',\n 'FIXED',\n 'GREATEST',\n 'GROUP_CONCAT',\n 'HOURS',\n 'HOUR_MINUTE',\n 'HOUR_SECOND',\n 'IFNULL',\n 'LEAST',\n 'LEVEL',\n 'MINUTE_SECOND',\n 'NULLIF',\n 'OFFSET',\n 'ON DELETE',\n 'ON UPDATE',\n 'OPTIMIZE',\n 'REGEXP',\n 'SEPARATOR',\n 'SIZE',\n 'STRING',\n 'TYPE',\n 'TYPES',\n 'UNSIGNED',\n 'VARIABLES',\n 'YEAR_MONTH',\n];\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// http://spark.apache.org/docs/latest/sql-ref-syntax.html\nconst reservedCommands = [\n // DDL\n 'ALTER COLUMN',\n 'ALTER DATABASE',\n 'ALTER TABLE',\n 'ALTER VIEW',\n 'CREATE DATABASE',\n 'CREATE FUNCTION',\n 'CREATE TABLE',\n 'CREATE VIEW',\n 'DROP DATABASE',\n 'DROP FUNCTION',\n 'DROP TABLE',\n 'DROP VIEW',\n 'REPAIR TABLE',\n 'TRUNCATE TABLE',\n 'USE DATABASE',\n // DML\n 'INSERT INTO',\n 'INSERT OVERWRITE',\n 'INSERT OVERWRITE DIRECTORY',\n 'LOAD',\n // Data Retrieval\n 'SELECT',\n 'WITH',\n 'CLUSTER BY',\n 'DISTRIBUTE BY',\n 'PARTITION BY', // verify\n 'GROUP BY',\n 'HAVING',\n 'VALUES',\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'SORT BY',\n 'TABLESAMPLE',\n 'WHERE',\n 'PIVOT',\n 'TRANSFORM',\n 'EXPLAIN',\n // Auxiliary\n 'ADD FILE',\n 'ADD JAR',\n 'ANALYZE TABLE',\n 'CACHE TABLE',\n 'CLEAR CACHE',\n 'DESCRIBE DATABASE',\n 'DESCRIBE FUNCTION',\n 'DESCRIBE QUERY',\n 'DESCRIBE TABLE',\n 'LIST FILE',\n 'LIST JAR',\n 'REFRESH',\n 'REFRESH TABLE',\n 'REFRESH FUNCTION',\n 'RESET',\n 'SET',\n 'SET SCHEMA', // verify\n 'SHOW COLUMNS',\n 'SHOW CREATE TABLE',\n 'SHOW DATABASES',\n 'SHOW FUNCTIONS',\n 'SHOW PARTITIONS',\n 'SHOW TABLE EXTENDED',\n 'SHOW TABLES',\n 'SHOW TBLPROPERTIES',\n 'SHOW VIEWS',\n 'UNCACHE TABLE',\n // other\n 'FROM',\n 'INSERT',\n 'LATERAL VIEW',\n 'UPDATE',\n 'WINDOW', // verify\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n 'MINUS',\n 'MINUS ALL',\n 'MINUS DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n // apply\n 'CROSS APPLY',\n 'OUTER APPLY',\n // non-standard-joins\n 'ANTI JOIN',\n 'SEMI JOIN',\n 'LEFT ANTI JOIN',\n 'LEFT SEMI JOIN',\n 'RIGHT OUTER JOIN',\n 'RIGHT SEMI JOIN',\n 'NATURAL ANTI JOIN',\n 'NATURAL FULL OUTER JOIN',\n 'NATURAL INNER JOIN',\n 'NATURAL LEFT ANTI JOIN',\n 'NATURAL LEFT OUTER JOIN',\n 'NATURAL LEFT SEMI JOIN',\n 'NATURAL OUTER JOIN',\n 'NATURAL RIGHT OUTER JOIN',\n 'NATURAL RIGHT SEMI JOIN',\n 'NATURAL SEMI JOIN',\n 'CROSS APPLY',\n 'OUTER APPLY',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\n// http://spark.apache.org/docs/latest/sql-programming-guide.html\nexport default class SparkSqlFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR', 'XOR'];\n static reservedKeywords = dedupe([\n ...Object.values(reservedFunctions).reduce((acc, arr) => [...acc, ...arr], []),\n ...reservedKeywords,\n ]);\n static stringTypes: StringPatternType[] = [`\"\"`, \"''\", '``', '{}'];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = ['$'];\n static lineCommentTypes = ['--'];\n static operators = ['<=>', '&&', '||', '==', '->'];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: SparkSqlFormatter.reservedCommands,\n reservedBinaryCommands: SparkSqlFormatter.reservedBinaryCommands,\n reservedDependentClauses: SparkSqlFormatter.reservedDependentClauses,\n reservedJoinConditions: SparkSqlFormatter.reservedJoinConditions,\n reservedLogicalOperators: SparkSqlFormatter.reservedLogicalOperators,\n reservedKeywords: SparkSqlFormatter.reservedKeywords,\n stringTypes: SparkSqlFormatter.stringTypes,\n blockStart: SparkSqlFormatter.blockStart,\n blockEnd: SparkSqlFormatter.blockEnd,\n indexedPlaceholderTypes: SparkSqlFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: SparkSqlFormatter.namedPlaceholderTypes,\n lineCommentTypes: SparkSqlFormatter.lineCommentTypes,\n operators: SparkSqlFormatter.operators,\n });\n }\n\n tokenOverride(token: Token) {\n // [WINDOW](...)\n if (isToken.WINDOW(token) && this.tokenLookAhead().type === TokenType.BLOCK_START) {\n // This is a function call, treat it as a reserved word\n return { type: TokenType.RESERVED_KEYWORD, value: token.value };\n }\n\n // .[END]\n if (isToken.END(token) && this.tokenLookBehind().value === '.') {\n // This is window().end (or similar) not CASE ... END\n return { type: TokenType.WORD, value: token.value };\n }\n\n // TODO: deprecate this once ITEMS is merged with COLLECTION\n if (/ITEMS/i.test(token.value) && token.type === TokenType.RESERVED_KEYWORD) {\n if (\n !(\n /COLLECTION/i.test(this.tokenLookBehind().value) &&\n /TERMINATED/i.test(this.tokenLookAhead().value)\n )\n ) {\n // this is a word and not COLLECTION ITEMS\n return { type: TokenType.WORD, value: token.value };\n }\n }\n\n return token;\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\n// https://jakewheat.github.io/sql-overview/sql-2008-foundation-grammar.html#reserved-word\nconst reservedKeywords = [\n 'ABS',\n 'ALL',\n 'ALLOCATE',\n 'ALTER',\n 'ANY',\n 'ARE',\n 'ARRAY',\n 'AS',\n 'ASENSITIVE',\n 'ASYMMETRIC',\n 'AT',\n 'ATOMIC',\n 'AUTHORIZATION',\n 'AVG',\n 'BEGIN',\n 'BETWEEN',\n 'BIGINT',\n 'BINARY',\n 'BLOB',\n 'BOOLEAN',\n 'BOTH',\n 'BY',\n 'CALL',\n 'CALLED',\n 'CARDINALITY',\n 'CASCADED',\n 'CAST',\n 'CEIL',\n 'CEILING',\n 'CHAR',\n 'CHARACTER',\n 'CHARACTER_LENGTH',\n 'CHAR_LENGTH',\n 'CHECK',\n 'CLOB',\n 'CLOSE',\n 'COALESCE',\n 'COLLATE',\n 'COLLECT',\n 'COLUMN',\n 'COMMIT',\n 'CONDITION',\n 'CONNECT',\n 'CONSTRAINT',\n 'CONVERT',\n 'CORR',\n 'CORRESPONDING',\n 'COUNT',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'CREATE',\n 'CROSS',\n 'CUBE',\n 'CUME_DIST',\n 'CURRENT',\n 'CURRENT_CATALOG',\n 'CURRENT_DATE',\n 'CURRENT_DEFAULT_TRANSFORM_GROUP',\n 'CURRENT_PATH',\n 'CURRENT_ROLE',\n 'CURRENT_SCHEMA',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_TRANSFORM_GROUP_FOR_TYPE',\n 'CURRENT_USER',\n 'CURSOR',\n 'CYCLE',\n 'DATE',\n 'DAY',\n 'DEALLOCATE',\n 'DEC',\n 'DECIMAL',\n 'DECLARE',\n 'DEFAULT',\n 'DELETE',\n 'DENSE_RANK',\n 'DEREF',\n 'DESCRIBE',\n 'DETERMINISTIC',\n 'DISCONNECT',\n 'DISTINCT',\n 'DOUBLE',\n 'DROP',\n 'DYNAMIC',\n 'EACH',\n 'ELEMENT',\n 'END-EXEC',\n 'ESCAPE',\n 'EVERY',\n 'EXCEPT',\n 'EXEC',\n 'EXECUTE',\n 'EXISTS',\n 'EXP',\n 'EXTERNAL',\n 'EXTRACT',\n 'FALSE',\n 'FETCH',\n 'FILTER',\n 'FLOAT',\n 'FLOOR',\n 'FOR',\n 'FOREIGN',\n 'FREE',\n 'FROM',\n 'FULL',\n 'FUNCTION',\n 'FUSION',\n 'GET',\n 'GLOBAL',\n 'GRANT',\n 'GROUP',\n 'GROUPING',\n 'HAVING',\n 'HOLD',\n 'HOUR',\n 'IDENTITY',\n 'IN',\n 'INDICATOR',\n 'INNER',\n 'INOUT',\n 'INSENSITIVE',\n 'INSERT',\n 'INT',\n 'INTEGER',\n 'INTERSECT',\n 'INTERSECTION',\n 'INTERVAL',\n 'INTO',\n 'IS',\n 'LANGUAGE',\n 'LARGE',\n 'LATERAL',\n 'LEADING',\n 'LEFT',\n 'LIKE',\n 'LIKE_REGEX',\n 'LN',\n 'LOCAL',\n 'LOCALTIME',\n 'LOCALTIMESTAMP',\n 'LOWER',\n 'MATCH',\n 'MAX',\n 'MEMBER',\n 'MERGE',\n 'METHOD',\n 'MIN',\n 'MINUTE',\n 'MOD',\n 'MODIFIES',\n 'MODULE',\n 'MONTH',\n 'MULTISET',\n 'NATIONAL',\n 'NATURAL',\n 'NCHAR',\n 'NCLOB',\n 'NEW',\n 'NO',\n 'NONE',\n 'NORMALIZE',\n 'NOT',\n 'NULL',\n 'NULLIF',\n 'NUMERIC',\n 'OCCURRENCES_REGEX',\n 'OCTET_LENGTH',\n 'OF',\n 'OLD',\n 'ON DELETE',\n 'ON UPDATE',\n 'ONLY',\n 'OPEN',\n 'ORDER',\n 'OUT',\n 'OUTER',\n 'OVER',\n 'OVERLAPS',\n 'OVERLAY',\n 'PARAMETER',\n 'PARTITION',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'PERCENT_RANK',\n 'POSITION',\n 'POSITION_REGEX',\n 'POWER',\n 'PRECISION',\n 'PREPARE',\n 'PRIMARY',\n 'PROCEDURE',\n 'RANGE',\n 'RANK',\n 'READS',\n 'REAL',\n 'RECURSIVE',\n 'REF',\n 'REFERENCES',\n 'REFERENCING',\n 'REGR_AVGX',\n 'REGR_AVGY',\n 'REGR_COUNT',\n 'REGR_INTERCEPT',\n 'REGR_R2',\n 'REGR_SLOPE',\n 'REGR_SXX',\n 'REGR_SXY',\n 'REGR_SYY',\n 'RELEASE',\n 'RESULT',\n 'RETURN',\n 'RETURNS',\n 'REVOKE',\n 'RIGHT',\n 'ROLLBACK',\n 'ROLLUP',\n 'ROW',\n 'ROWS',\n 'ROW_NUMBER',\n 'SAVEPOINT',\n 'SCOPE',\n 'SCROLL',\n 'SEARCH',\n 'SECOND',\n 'SELECT',\n 'SENSITIVE',\n 'SESSION_USER',\n 'SET',\n 'SIMILAR',\n 'SMALLINT',\n 'SOME',\n 'SPECIFIC',\n 'SPECIFICTYPE',\n 'SQL',\n 'SQLEXCEPTION',\n 'SQLSTATE',\n 'SQLWARNING',\n 'SQRT',\n 'START',\n 'STATIC',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'SUBMULTISET',\n 'SUBSTRING',\n 'SUBSTRING_REGEX',\n 'SUM',\n 'SYMMETRIC',\n 'SYSTEM',\n 'SYSTEM_USER',\n 'TABLE',\n 'TABLESAMPLE',\n 'THEN',\n 'TIME',\n 'TIMESTAMP',\n 'TIMEZONE_HOUR',\n 'TIMEZONE_MINUTE',\n 'TO',\n 'TRAILING',\n 'TRANSLATE',\n 'TRANSLATE_REGEX',\n 'TRANSLATION',\n 'TREAT',\n 'TRIGGER',\n 'TRIM',\n 'TRUE',\n 'UESCAPE',\n 'UNION',\n 'UNIQUE',\n 'UNKNOWN',\n 'UNNEST',\n 'UPDATE',\n 'UPPER',\n 'USER',\n 'VALUE',\n 'VALUES',\n 'VARBINARY',\n 'VARCHAR',\n 'VARYING',\n 'VAR_POP',\n 'VAR_SAMP',\n 'WHENEVER',\n 'WIDTH_BUCKET',\n 'WINDOW',\n 'WITHIN',\n 'WITHOUT',\n 'YEAR',\n];\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\nconst reservedCommands = [\n 'ADD',\n 'ALTER COLUMN',\n 'ALTER TABLE',\n 'CREATE TABLE',\n 'DROP TABLE',\n 'END',\n 'FETCH FIRST',\n 'FETCH NEXT',\n 'FETCH PRIOR',\n 'FETCH LAST',\n 'FETCH ABSOLUTE',\n 'FETCH RELATIVE',\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'INSERT INTO',\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'SELECT',\n 'SET SCHEMA',\n 'SET',\n 'UPDATE',\n 'VALUES',\n 'WHERE',\n 'WITH',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n 'NATURAL JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\nexport default class StandardSqlFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR'];\n static reservedKeywords = dedupe(reservedKeywords);\n static stringTypes: StringPatternType[] = [`\"\"`, \"''\", '``'];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = ['?'];\n static namedPlaceholderTypes = [];\n static lineCommentTypes = ['--'];\n static operators = [];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: StandardSqlFormatter.reservedCommands,\n reservedBinaryCommands: StandardSqlFormatter.reservedBinaryCommands,\n reservedDependentClauses: StandardSqlFormatter.reservedDependentClauses,\n reservedJoinConditions: StandardSqlFormatter.reservedJoinConditions,\n reservedLogicalOperators: StandardSqlFormatter.reservedLogicalOperators,\n reservedKeywords: StandardSqlFormatter.reservedKeywords,\n stringTypes: StandardSqlFormatter.stringTypes,\n blockStart: StandardSqlFormatter.blockStart,\n blockEnd: StandardSqlFormatter.blockEnd,\n indexedPlaceholderTypes: StandardSqlFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: StandardSqlFormatter.namedPlaceholderTypes,\n lineCommentTypes: StandardSqlFormatter.lineCommentTypes,\n });\n }\n}\n","import Formatter from '../core/Formatter';\nimport Tokenizer from '../core/Tokenizer';\nimport type { StringPatternType } from '../core/regexFactory';\nimport { dedupe } from '../utils';\n\n/**\n * Priority 5 (last)\n * Full list of reserved functions\n * distinct from Keywords due to interaction with parentheses\n */\n// https://docs.microsoft.com/en-us/sql/t-sql/functions/functions?view=sql-server-ver15\nconst reservedFunctions = {\n aggregate: [\n 'APPROX_COUNT_DISTINCT',\n 'AVG',\n 'CHECKSUM_AGG',\n 'COUNT',\n 'COUNT_BIG',\n 'GROUPING',\n 'GROUPING_ID',\n 'MAX',\n 'MIN',\n 'STDEV',\n 'STDEVP',\n 'SUM',\n 'VAR',\n 'VARP',\n ],\n analytic: [\n 'CUME_DIST',\n 'FIRST_VALUE',\n 'LAG',\n 'LAST_VALUE',\n 'LEAD',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'PERCENT_RANK',\n 'Collation - COLLATIONPROPERTY',\n 'Collation - TERTIARY_WEIGHTS',\n ],\n configuration: [\n '@@DBTS',\n '@@LANGID',\n '@@LANGUAGE',\n '@@LOCK_TIMEOUT',\n '@@MAX_CONNECTIONS',\n '@@MAX_PRECISION',\n '@@NESTLEVEL',\n '@@OPTIONS',\n '@@REMSERVER',\n '@@SERVERNAME',\n '@@SERVICENAME',\n '@@SPID',\n '@@TEXTSIZE',\n '@@VERSION',\n ],\n conversion: ['CAST', 'CONVERT', 'PARSE', 'TRY_CAST', 'TRY_CONVERT', 'TRY_PARSE'],\n cryptographic: [\n 'ASYMKEY_ID',\n 'ASYMKEYPROPERTY',\n 'CERTPROPERTY',\n 'CERT_ID',\n 'CRYPT_GEN_RANDOM',\n 'DECRYPTBYASYMKEY',\n 'DECRYPTBYCERT',\n 'DECRYPTBYKEY',\n 'DECRYPTBYKEYAUTOASYMKEY',\n 'DECRYPTBYKEYAUTOCERT',\n 'DECRYPTBYPASSPHRASE',\n 'ENCRYPTBYASYMKEY',\n 'ENCRYPTBYCERT',\n 'ENCRYPTBYKEY',\n 'ENCRYPTBYPASSPHRASE',\n 'HASHBYTES',\n 'IS_OBJECTSIGNED',\n 'KEY_GUID',\n 'KEY_ID',\n 'KEY_NAME',\n 'SIGNBYASYMKEY',\n 'SIGNBYCERT',\n 'SYMKEYPROPERTY',\n 'VERIFYSIGNEDBYCERT',\n 'VERIFYSIGNEDBYASYMKEY',\n ],\n cursor: ['@@CURSOR_ROWS', '@@FETCH_STATUS', 'CURSOR_STATUS'],\n dataType: [\n 'DATALENGTH',\n 'IDENT_CURRENT',\n 'IDENT_INCR',\n 'IDENT_SEED',\n 'IDENTITY',\n 'SQL_VARIANT_PROPERTY',\n ],\n datetime: [\n '@@DATEFIRST',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_TIMEZONE',\n 'CURRENT_TIMEZONE_ID',\n 'DATEADD',\n 'DATEDIFF',\n 'DATEDIFF_BIG',\n 'DATEFROMPARTS',\n 'DATENAME',\n 'DATEPART',\n 'DATETIME2FROMPARTS',\n 'DATETIMEFROMPARTS',\n 'DATETIMEOFFSETFROMPARTS',\n 'DAY',\n 'EOMONTH',\n 'GETDATE',\n 'GETUTCDATE',\n 'ISDATE',\n 'MONTH',\n 'SMALLDATETIMEFROMPARTS',\n 'SWITCHOFFSET',\n 'SYSDATETIME',\n 'SYSDATETIMEOFFSET',\n 'SYSUTCDATETIME',\n 'TIMEFROMPARTS',\n 'TODATETIMEOFFSET',\n 'YEAR',\n 'JSON',\n 'ISJSON',\n 'JSON_VALUE',\n 'JSON_QUERY',\n 'JSON_MODIFY',\n ],\n mathematical: [\n 'ABS',\n 'ACOS',\n 'ASIN',\n 'ATAN',\n 'ATN2',\n 'CEILING',\n 'COS',\n 'COT',\n 'DEGREES',\n 'EXP',\n 'FLOOR',\n 'LOG',\n 'LOG10',\n 'PI',\n 'POWER',\n 'RADIANS',\n 'RAND',\n 'ROUND',\n 'SIGN',\n 'SIN',\n 'SQRT',\n 'SQUARE',\n 'TAN',\n 'CHOOSE',\n 'GREATEST',\n 'IIF',\n 'LEAST',\n ],\n metadata: [\n '@@PROCID',\n 'APP_NAME',\n 'APPLOCK_MODE',\n 'APPLOCK_TEST',\n 'ASSEMBLYPROPERTY',\n 'COL_LENGTH',\n 'COL_NAME',\n 'COLUMNPROPERTY',\n 'DATABASEPROPERTYEX',\n 'DB_ID',\n 'DB_NAME',\n 'FILE_ID',\n 'FILE_IDEX',\n 'FILE_NAME',\n 'FILEGROUP_ID',\n 'FILEGROUP_NAME',\n 'FILEGROUPPROPERTY',\n 'FILEPROPERTY',\n 'FILEPROPERTYEX',\n 'FULLTEXTCATALOGPROPERTY',\n 'FULLTEXTSERVICEPROPERTY',\n 'INDEX_COL',\n 'INDEXKEY_PROPERTY',\n 'INDEXPROPERTY',\n 'NEXT VALUE FOR',\n 'OBJECT_DEFINITION',\n 'OBJECT_ID',\n 'OBJECT_NAME',\n 'OBJECT_SCHEMA_NAME',\n 'OBJECTPROPERTY',\n 'OBJECTPROPERTYEX',\n 'ORIGINAL_DB_NAME',\n 'PARSENAME',\n 'SCHEMA_ID',\n 'SCHEMA_NAME',\n 'SCOPE_IDENTITY',\n 'SERVERPROPERTY',\n 'STATS_DATE',\n 'TYPE_ID',\n 'TYPE_NAME',\n 'TYPEPROPERTY',\n ],\n ranking: ['DENSE_RANK', 'NTILE', 'RANK', 'ROW_NUMBER', 'PUBLISHINGSERVERNAME'],\n security: [\n 'CERTENCODED',\n 'CERTPRIVATEKEY',\n 'CURRENT_USER',\n 'DATABASE_PRINCIPAL_ID',\n 'HAS_DBACCESS',\n 'HAS_PERMS_BY_NAME',\n 'IS_MEMBER',\n 'IS_ROLEMEMBER',\n 'IS_SRVROLEMEMBER',\n 'LOGINPROPERTY',\n 'ORIGINAL_LOGIN',\n 'PERMISSIONS',\n 'PWDENCRYPT',\n 'PWDCOMPARE',\n 'SESSION_USER',\n 'SESSIONPROPERTY',\n 'SUSER_ID',\n 'SUSER_NAME',\n 'SUSER_SID',\n 'SUSER_SNAME',\n 'SYSTEM_USER',\n 'USER',\n 'USER_ID',\n 'USER_NAME',\n ],\n string: [\n 'ASCII',\n 'CHAR',\n 'CHARINDEX',\n 'CONCAT',\n 'CONCAT_WS',\n 'DIFFERENCE',\n 'FORMAT',\n 'LEFT',\n 'LEN',\n 'LOWER',\n 'LTRIM',\n 'NCHAR',\n 'PATINDEX',\n 'QUOTENAME',\n 'REPLACE',\n 'REPLICATE',\n 'REVERSE',\n 'RIGHT',\n 'RTRIM',\n 'SOUNDEX',\n 'SPACE',\n 'STR',\n 'STRING_AGG',\n 'STRING_ESCAPE',\n 'STUFF',\n 'SUBSTRING',\n 'TRANSLATE',\n 'TRIM',\n 'UNICODE',\n 'UPPER',\n ],\n system: [\n '$PARTITION',\n '@@ERROR',\n '@@IDENTITY',\n '@@PACK_RECEIVED',\n '@@ROWCOUNT',\n '@@TRANCOUNT',\n 'BINARY_CHECKSUM',\n 'CHECKSUM',\n 'COMPRESS',\n 'CONNECTIONPROPERTY',\n 'CONTEXT_INFO',\n 'CURRENT_REQUEST_ID',\n 'CURRENT_TRANSACTION_ID',\n 'DECOMPRESS',\n 'ERROR_LINE',\n 'ERROR_MESSAGE',\n 'ERROR_NUMBER',\n 'ERROR_PROCEDURE',\n 'ERROR_SEVERITY',\n 'ERROR_STATE',\n 'FORMATMESSAGE',\n 'GET_FILESTREAM_TRANSACTION_CONTEXT',\n 'GETANSINULL',\n 'HOST_ID',\n 'HOST_NAME',\n 'ISNULL',\n 'ISNUMERIC',\n 'MIN_ACTIVE_ROWVERSION',\n 'NEWID',\n 'NEWSEQUENTIALID',\n 'ROWCOUNT_BIG',\n 'SESSION_CONTEXT',\n 'XACT_STATE',\n ],\n statistical: [\n '@@CONNECTIONS',\n '@@CPU_BUSY',\n '@@IDLE',\n '@@IO_BUSY',\n '@@PACK_SENT',\n '@@PACKET_ERRORS',\n '@@TIMETICKS',\n '@@TOTAL_ERRORS',\n '@@TOTAL_READ',\n '@@TOTAL_WRITE',\n 'TEXTPTR',\n 'TEXTVALID',\n ],\n trigger: ['COLUMNS_UPDATED', 'EVENTDATA', 'TRIGGER_NESTLEVEL', 'UPDATE'],\n};\n\n// TODO: dedupe these reserved word lists\n// https://docs.microsoft.com/en-us/sql/t-sql/language-elements/reserved-keywords-transact-sql?view=sql-server-ver15\n/**\n * Priority 5 (last)\n * Full list of reserved words\n * any words that are in a higher priority are removed\n */\nconst reservedKeywords = {\n standard: [\n 'ADD',\n 'ALL',\n 'ALTER',\n 'AND',\n 'ANY',\n 'AS',\n 'ASC',\n 'AUTHORIZATION',\n 'BACKUP',\n 'BEGIN',\n 'BETWEEN',\n 'BREAK',\n 'BROWSE',\n 'BULK',\n 'BY',\n 'CASCADE',\n 'CASE',\n 'CHECK',\n 'CHECKPOINT',\n 'CLOSE',\n 'CLUSTERED',\n 'COALESCE',\n 'COLLATE',\n 'COLUMN',\n 'COMMIT',\n 'COMPUTE',\n 'CONSTRAINT',\n 'CONTAINS',\n 'CONTAINSTABLE',\n 'CONTINUE',\n 'CONVERT',\n 'CREATE',\n 'CROSS',\n 'CURRENT',\n 'CURRENT_DATE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_USER',\n 'CURSOR',\n 'DATABASE',\n 'DBCC',\n 'DEALLOCATE',\n 'DECLARE',\n 'DEFAULT',\n 'DELETE',\n 'DENY',\n 'DESC',\n 'DISK',\n 'DISTINCT',\n 'DISTRIBUTED',\n 'DOUBLE',\n 'DROP',\n 'DUMP',\n 'ERRLVL',\n 'ESCAPE',\n 'EXEC',\n 'EXECUTE',\n 'EXISTS',\n 'EXIT',\n 'EXTERNAL',\n 'FETCH',\n 'FILE',\n 'FILLFACTOR',\n 'FOR',\n 'FOREIGN',\n 'FREETEXT',\n 'FREETEXTTABLE',\n 'FROM',\n 'FULL',\n 'FUNCTION',\n 'GOTO',\n 'GRANT',\n 'GROUP',\n 'HAVING',\n 'HOLDLOCK',\n 'IDENTITY',\n 'IDENTITYCOL',\n 'IDENTITY_INSERT',\n 'IF',\n 'IN',\n 'INDEX',\n 'INNER',\n 'INSERT',\n 'INTERSECT',\n 'INTO',\n 'IS',\n 'JOIN',\n 'KEY',\n 'KILL',\n 'LEFT',\n 'LIKE',\n 'LINENO',\n 'LOAD',\n 'MERGE',\n 'NATIONAL',\n 'NOCHECK',\n 'NONCLUSTERED',\n 'NOT',\n 'NULL',\n 'NULLIF',\n 'OF',\n 'OFF',\n 'OFFSETS',\n 'ON DELETE',\n 'ON UPDATE',\n 'OPEN',\n 'OPENDATASOURCE',\n 'OPENQUERY',\n 'OPENROWSET',\n 'OPENXML',\n 'OPTION',\n 'OR',\n 'ORDER',\n 'OUTER',\n 'OVER',\n 'PERCENT',\n 'PIVOT',\n 'PLAN',\n 'PRECISION',\n 'PRIMARY',\n 'PRINT',\n 'PROC',\n 'PROCEDURE',\n 'PUBLIC',\n 'RAISERROR',\n 'READ',\n 'READTEXT',\n 'RECONFIGURE',\n 'REFERENCES',\n 'REPLICATION',\n 'RESTORE',\n 'RESTRICT',\n 'RETURN',\n 'REVERT',\n 'REVOKE',\n 'RIGHT',\n 'ROLLBACK',\n 'ROWCOUNT',\n 'ROWGUIDCOL',\n 'RULE',\n 'SAVE',\n 'SCHEMA',\n 'SECURITYAUDIT',\n 'SELECT',\n 'SEMANTICKEYPHRASETABLE',\n 'SEMANTICSIMILARITYDETAILSTABLE',\n 'SEMANTICSIMILARITYTABLE',\n 'SESSION_USER',\n 'SET',\n 'SETUSER',\n 'SHUTDOWN',\n 'SOME',\n 'STATISTICS',\n 'SYSTEM_USER',\n 'TABLE',\n 'TABLESAMPLE',\n 'TEXTSIZE',\n 'THEN',\n 'TO',\n 'TOP',\n 'TRAN',\n 'TRANSACTION',\n 'TRIGGER',\n 'TRUNCATE',\n 'TRY_CONVERT',\n 'TSEQUAL',\n 'UNION',\n 'UNIQUE',\n 'UNPIVOT',\n 'UPDATE',\n 'UPDATETEXT',\n 'USE',\n 'USER',\n 'VALUES',\n 'VARYING',\n 'VIEW',\n 'WAITFOR',\n 'WHERE',\n 'WHILE',\n 'WITH',\n 'WITHIN GROUP',\n 'WRITETEXT',\n ],\n odbc: [\n 'ABSOLUTE',\n 'ACTION',\n 'ADA',\n 'ADD',\n 'ALL',\n 'ALLOCATE',\n 'ALTER',\n 'AND',\n 'ANY',\n 'ARE',\n 'AS',\n 'ASC',\n 'ASSERTION',\n 'AT',\n 'AUTHORIZATION',\n 'AVG',\n 'BEGIN',\n 'BETWEEN',\n 'BIT',\n 'BIT_LENGTH',\n 'BOTH',\n 'BY',\n 'CASCADE',\n 'CASCADED',\n 'CASE',\n 'CAST',\n 'CATALOG',\n 'CHAR',\n 'CHARACTER',\n 'CHARACTER_LENGTH',\n 'CHAR_LENGTH',\n 'CHECK',\n 'CLOSE',\n 'COALESCE',\n 'COLLATE',\n 'COLLATION',\n 'COLUMN',\n 'COMMIT',\n 'CONNECT',\n 'CONNECTION',\n 'CONSTRAINT',\n 'CONSTRAINTS',\n 'CONTINUE',\n 'CONVERT',\n 'CORRESPONDING',\n 'COUNT',\n 'CREATE',\n 'CROSS',\n 'CURRENT',\n 'CURRENT_DATE',\n 'CURRENT_TIME',\n 'CURRENT_TIMESTAMP',\n 'CURRENT_USER',\n 'CURSOR',\n 'DATE',\n 'DAY',\n 'DEALLOCATE',\n 'DEC',\n 'DECIMAL',\n 'DECLARE',\n 'DEFAULT',\n 'DEFERRABLE',\n 'DEFERRED',\n 'DELETE',\n 'DESC',\n 'DESCRIBE',\n 'DESCRIPTOR',\n 'DIAGNOSTICS',\n 'DISCONNECT',\n 'DISTINCT',\n 'DOMAIN',\n 'DOUBLE',\n 'DROP',\n 'END-EXEC',\n 'ESCAPE',\n 'EXCEPTION',\n 'EXEC',\n 'EXECUTE',\n 'EXISTS',\n 'EXTERNAL',\n 'EXTRACT',\n 'FALSE',\n 'FETCH',\n 'FIRST',\n 'FLOAT',\n 'FOR',\n 'FOREIGN',\n 'FORTRAN',\n 'FOUND',\n 'FROM',\n 'FULL',\n 'GET',\n 'GLOBAL',\n 'GO',\n 'GOTO',\n 'GRANT',\n 'GROUP',\n 'HAVING',\n 'HOUR',\n 'IDENTITY',\n 'IMMEDIATE',\n 'IN',\n 'INCLUDE',\n 'INDEX',\n 'INDICATOR',\n 'INITIALLY',\n 'INNER',\n 'INPUT',\n 'INSENSITIVE',\n 'INSERT',\n 'INT',\n 'INTEGER',\n 'INTERSECT',\n 'INTERVAL',\n 'INTO',\n 'IS',\n 'ISOLATION',\n 'JOIN',\n 'KEY',\n 'LANGUAGE',\n 'LAST',\n 'LEADING',\n 'LEFT',\n 'LEVEL',\n 'LIKE',\n 'LOCAL',\n 'LOWER',\n 'MATCH',\n 'MAX',\n 'MIN',\n 'MINUTE',\n 'MODULE',\n 'MONTH',\n 'NAMES',\n 'NATIONAL',\n 'NATURAL',\n 'NCHAR',\n 'NEXT',\n 'NO',\n 'NONE',\n 'NOT',\n 'NULL',\n 'NULLIF',\n 'NUMERIC',\n 'OCTET_LENGTH',\n 'OF',\n 'ONLY',\n 'OPEN',\n 'OPTION',\n 'OR',\n 'ORDER',\n 'OUTER',\n 'OUTPUT',\n 'OVERLAPS',\n 'PAD',\n 'PARTIAL',\n 'PASCAL',\n 'POSITION',\n 'PRECISION',\n 'PREPARE',\n 'PRESERVE',\n 'PRIMARY',\n 'PRIOR',\n 'PRIVILEGES',\n 'PROCEDURE',\n 'PUBLIC',\n 'READ',\n 'REAL',\n 'REFERENCES',\n 'RELATIVE',\n 'RESTRICT',\n 'REVOKE',\n 'RIGHT',\n 'ROLLBACK',\n 'ROWS',\n 'SCHEMA',\n 'SCROLL',\n 'SECOND',\n 'SECTION',\n 'SELECT',\n 'SESSION',\n 'SESSION_USER',\n 'SET',\n 'SIZE',\n 'SMALLINT',\n 'SOME',\n 'SPACE',\n 'SQL',\n 'SQLCA',\n 'SQLCODE',\n 'SQLERROR',\n 'SQLSTATE',\n 'SQLWARNING',\n 'SUBSTRING',\n 'SUM',\n 'SYSTEM_USER',\n 'TABLE',\n 'TEMPORARY',\n 'TIME',\n 'TIMESTAMP',\n 'TIMEZONE_HOUR',\n 'TIMEZONE_MINUTE',\n 'TO',\n 'TRAILING',\n 'TRANSACTION',\n 'TRANSLATE',\n 'TRANSLATION',\n 'TRIM',\n 'TRUE',\n 'UNION',\n 'UNIQUE',\n 'UNKNOWN',\n 'UPDATE',\n 'UPPER',\n 'USAGE',\n 'USER',\n 'VALUE',\n 'VALUES',\n 'VARCHAR',\n 'VARYING',\n 'VIEW',\n 'WHENEVER',\n 'WHERE',\n 'WITH',\n 'WORK',\n 'WRITE',\n 'YEAR',\n 'ZONE',\n ],\n future: [\n 'ABSOLUTE',\n 'ACTION',\n 'ADMIN',\n 'AFTER',\n 'AGGREGATE',\n 'ALIAS',\n 'ALLOCATE',\n 'ARE',\n 'ARRAY',\n 'ASENSITIVE',\n 'ASSERTION',\n 'ASYMMETRIC',\n 'AT',\n 'ATOMIC',\n 'BEFORE',\n 'BINARY',\n 'BIT',\n 'BLOB',\n 'BOOLEAN',\n 'BOTH',\n 'BREADTH',\n 'CALL',\n 'CALLED',\n 'CARDINALITY',\n 'CASCADED',\n 'CAST',\n 'CATALOG',\n 'CHAR',\n 'CHARACTER',\n 'CLASS',\n 'CLOB',\n 'COLLATION',\n 'COLLECT',\n 'COMPLETION',\n 'CONDITION',\n 'CONNECT',\n 'CONNECTION',\n 'CONSTRAINTS',\n 'CONSTRUCTOR',\n 'CORR',\n 'CORRESPONDING',\n 'COVAR_POP',\n 'COVAR_SAMP',\n 'CUBE',\n 'CUME_DIST',\n 'CURRENT_CATALOG',\n 'CURRENT_DEFAULT_TRANSFORM_GROUP',\n 'CURRENT_PATH',\n 'CURRENT_ROLE',\n 'CURRENT_SCHEMA',\n 'CURRENT_TRANSFORM_GROUP_FOR_TYPE',\n 'CYCLE',\n 'DATA',\n 'DATE',\n 'DAY',\n 'DEC',\n 'DECIMAL',\n 'DEFERRABLE',\n 'DEFERRED',\n 'DEPTH',\n 'DEREF',\n 'DESCRIBE',\n 'DESCRIPTOR',\n 'DESTROY',\n 'DESTRUCTOR',\n 'DETERMINISTIC',\n 'DIAGNOSTICS',\n 'DICTIONARY',\n 'DISCONNECT',\n 'DOMAIN',\n 'DYNAMIC',\n 'EACH',\n 'ELEMENT',\n 'END-EXEC',\n 'EQUALS',\n 'EVERY',\n 'FALSE',\n 'FILTER',\n 'FIRST',\n 'FLOAT',\n 'FOUND',\n 'FREE',\n 'FULLTEXTTABLE',\n 'FUSION',\n 'GENERAL',\n 'GET',\n 'GLOBAL',\n 'GO',\n 'GROUPING',\n 'HOLD',\n 'HOST',\n 'HOUR',\n 'IGNORE',\n 'IMMEDIATE',\n 'INDICATOR',\n 'INITIALIZE',\n 'INITIALLY',\n 'INOUT',\n 'INPUT',\n 'INT',\n 'INTEGER',\n 'INTERSECTION',\n 'INTERVAL',\n 'ISOLATION',\n 'ITERATE',\n 'LANGUAGE',\n 'LARGE',\n 'LAST',\n 'LATERAL',\n 'LEADING',\n 'LESS',\n 'LEVEL',\n 'LIKE_REGEX',\n 'LIMIT',\n 'LN',\n 'LOCAL',\n 'LOCALTIME',\n 'LOCALTIMESTAMP',\n 'LOCATOR',\n 'MAP',\n 'MATCH',\n 'MEMBER',\n 'METHOD',\n 'MINUTE',\n 'MOD',\n 'MODIFIES',\n 'MODIFY',\n 'MODULE',\n 'MONTH',\n 'MULTISET',\n 'NAMES',\n 'NATURAL',\n 'NCHAR',\n 'NCLOB',\n 'NEW',\n 'NEXT',\n 'NO',\n 'NONE',\n 'NORMALIZE',\n 'NUMERIC',\n 'OBJECT',\n 'OCCURRENCES_REGEX',\n 'OLD',\n 'ONLY',\n 'OPERATION',\n 'ORDINALITY',\n 'OUT',\n 'OUTPUT',\n 'OVERLAY',\n 'PAD',\n 'PARAMETER',\n 'PARAMETERS',\n 'PARTIAL',\n 'PARTITION',\n 'PATH',\n 'PERCENTILE_CONT',\n 'PERCENTILE_DISC',\n 'PERCENT_RANK',\n 'POSITION_REGEX',\n 'POSTFIX',\n 'PREFIX',\n 'PREORDER',\n 'PREPARE',\n 'PRESERVE',\n 'PRIOR',\n 'PRIVILEGES',\n 'RANGE',\n 'READS',\n 'REAL',\n 'RECURSIVE',\n 'REF',\n 'REFERENCING',\n 'REGR_AVGX',\n 'REGR_AVGY',\n 'REGR_COUNT',\n 'REGR_INTERCEPT',\n 'REGR_R2',\n 'REGR_SLOPE',\n 'REGR_SXX',\n 'REGR_SXY',\n 'REGR_SYY',\n 'RELATIVE',\n 'RELEASE',\n 'RESULT',\n 'RETURNS',\n 'ROLE',\n 'ROLLUP',\n 'ROUTINE',\n 'ROW',\n 'ROWS',\n 'SAVEPOINT',\n 'SCOPE',\n 'SCROLL',\n 'SEARCH',\n 'SECOND',\n 'SECTION',\n 'SENSITIVE',\n 'SEQUENCE',\n 'SESSION',\n 'SETS',\n 'SIMILAR',\n 'SIZE',\n 'SMALLINT',\n 'SPACE',\n 'SPECIFIC',\n 'SPECIFICTYPE',\n 'SQL',\n 'SQLEXCEPTION',\n 'SQLSTATE',\n 'SQLWARNING',\n 'START',\n 'STATE',\n 'STATEMENT',\n 'STATIC',\n 'STDDEV_POP',\n 'STDDEV_SAMP',\n 'STRUCTURE',\n 'SUBMULTISET',\n 'SUBSTRING_REGEX',\n 'SYMMETRIC',\n 'SYSTEM',\n 'TEMPORARY',\n 'TERMINATE',\n 'THAN',\n 'TIME',\n 'TIMESTAMP',\n 'TIMEZONE_HOUR',\n 'TIMEZONE_MINUTE',\n 'TRAILING',\n 'TRANSLATE_REGEX',\n 'TRANSLATION',\n 'TREAT',\n 'TRUE',\n 'UESCAPE',\n 'UNDER',\n 'UNKNOWN',\n 'UNNEST',\n 'USAGE',\n 'USING',\n 'VALUE',\n 'VARCHAR',\n 'VARIABLE',\n 'VAR_POP',\n 'VAR_SAMP',\n 'WHENEVER',\n 'WIDTH_BUCKET',\n 'WINDOW',\n 'WITHIN',\n 'WITHOUT',\n 'WORK',\n 'WRITE',\n 'XMLAGG',\n 'XMLATTRIBUTES',\n 'XMLBINARY',\n 'XMLCAST',\n 'XMLCOMMENT',\n 'XMLCONCAT',\n 'XMLDOCUMENT',\n 'XMLELEMENT',\n 'XMLEXISTS',\n 'XMLFOREST',\n 'XMLITERATE',\n 'XMLNAMESPACES',\n 'XMLPARSE',\n 'XMLPI',\n 'XMLQUERY',\n 'XMLSERIALIZE',\n 'XMLTABLE',\n 'XMLTEXT',\n 'XMLVALIDATE',\n 'YEAR',\n 'ZONE',\n ],\n};\n\n/**\n * Priority 1 (first)\n * keywords that begin a new statement\n * will begin new indented block\n */\n// https://docs.microsoft.com/en-us/sql/t-sql/statements/statements?view=sql-server-ver15\nconst reservedCommands = [\n 'ADD SENSITIVITY CLASSIFICATION',\n 'ADD SIGNATURE',\n 'AGGREGATE',\n 'ANSI_DEFAULTS',\n 'ANSI_NULLS',\n 'ANSI_NULL_DFLT_OFF',\n 'ANSI_NULL_DFLT_ON',\n 'ANSI_PADDING',\n 'ANSI_WARNINGS',\n 'APPLICATION ROLE',\n 'ARITHABORT',\n 'ARITHIGNORE',\n 'ASSEMBLY',\n 'ASYMMETRIC KEY',\n 'AUTHORIZATION',\n 'AVAILABILITY GROUP',\n 'BACKUP',\n 'BACKUP CERTIFICATE',\n 'BACKUP MASTER KEY',\n 'BACKUP SERVICE MASTER KEY',\n 'BEGIN CONVERSATION TIMER',\n 'BEGIN DIALOG CONVERSATION',\n 'BROKER PRIORITY',\n 'BULK INSERT',\n 'CERTIFICATE',\n 'CLOSE MASTER KEY',\n 'CLOSE SYMMETRIC KEY',\n 'COLLATE',\n 'COLUMN ENCRYPTION KEY',\n 'COLUMN MASTER KEY',\n 'COLUMNSTORE INDEX',\n 'CONCAT_NULL_YIELDS_NULL',\n 'CONTEXT_INFO',\n 'CONTRACT',\n 'CREDENTIAL',\n 'CRYPTOGRAPHIC PROVIDER',\n 'CURSOR_CLOSE_ON_COMMIT',\n 'DATABASE',\n 'DATABASE AUDIT SPECIFICATION',\n 'DATABASE ENCRYPTION KEY',\n 'DATABASE HADR',\n 'DATABASE SCOPED CONFIGURATION',\n 'DATABASE SCOPED CREDENTIAL',\n 'DATABASE SET',\n 'DATEFIRST',\n 'DATEFORMAT',\n 'DEADLOCK_PRIORITY',\n 'DEFAULT',\n 'DELETE',\n 'DENY',\n 'DENY XML',\n 'DISABLE TRIGGER',\n 'ENABLE TRIGGER',\n 'END CONVERSATION',\n 'ENDPOINT',\n 'EVENT NOTIFICATION',\n 'EVENT SESSION',\n 'EXECUTE AS',\n 'EXTERNAL DATA SOURCE',\n 'EXTERNAL FILE FORMAT',\n 'EXTERNAL LANGUAGE',\n 'EXTERNAL LIBRARY',\n 'EXTERNAL RESOURCE POOL',\n 'EXTERNAL TABLE',\n 'FIPS_FLAGGER',\n 'FMTONLY',\n 'FORCEPLAN',\n 'FULLTEXT CATALOG',\n 'FULLTEXT INDEX',\n 'FULLTEXT STOPLIST',\n 'FUNCTION',\n 'GET CONVERSATION GROUP',\n 'GET_TRANSMISSION_STATUS',\n 'GRANT',\n 'GRANT XML',\n 'IDENTITY_INSERT',\n 'IMPLICIT_TRANSACTIONS',\n 'INDEX',\n 'INSERT',\n 'LANGUAGE',\n 'LOCK_TIMEOUT',\n 'LOGIN',\n 'MASTER KEY',\n 'MERGE',\n 'MESSAGE TYPE',\n 'MOVE CONVERSATION',\n 'NOCOUNT',\n 'NOEXEC',\n 'NUMERIC_ROUNDABORT',\n 'OFFSETS',\n 'OPEN MASTER KEY',\n 'OPEN SYMMETRIC KEY',\n 'PARSEONLY',\n 'PARTITION FUNCTION',\n 'PARTITION SCHEME',\n 'PROCEDURE',\n 'QUERY_GOVERNOR_COST_LIMIT',\n 'QUEUE',\n 'QUOTED_IDENTIFIER',\n 'RECEIVE',\n 'REMOTE SERVICE BINDING',\n 'REMOTE_PROC_TRANSACTIONS',\n 'RESOURCE GOVERNOR',\n 'RESOURCE POOL',\n 'RESTORE',\n 'RESTORE FILELISTONLY',\n 'RESTORE HEADERONLY',\n 'RESTORE LABELONLY',\n 'RESTORE MASTER KEY',\n 'RESTORE REWINDONLY',\n 'RESTORE SERVICE MASTER KEY',\n 'RESTORE VERIFYONLY',\n 'REVERT',\n 'REVOKE',\n 'REVOKE XML',\n 'ROLE',\n 'ROUTE',\n 'ROWCOUNT',\n 'RULE',\n 'SCHEMA',\n 'SEARCH PROPERTY LIST',\n 'SECURITY POLICY',\n 'SELECTIVE XML INDEX',\n 'SEND',\n 'SENSITIVITY CLASSIFICATION',\n 'SEQUENCE',\n 'SERVER AUDIT',\n 'SERVER AUDIT SPECIFICATION',\n 'SERVER CONFIGURATION',\n 'SERVER ROLE',\n 'SERVICE',\n 'SERVICE MASTER KEY',\n 'SET',\n 'SETUSER',\n 'SHOWPLAN_ALL',\n 'SHOWPLAN_TEXT',\n 'SHOWPLAN_XML',\n 'SIGNATURE',\n 'SPATIAL INDEX',\n 'STATISTICS',\n 'STATISTICS IO',\n 'STATISTICS PROFILE',\n 'STATISTICS TIME',\n 'STATISTICS XML',\n 'SYMMETRIC KEY',\n 'SYNONYM',\n 'TABLE',\n 'TABLE IDENTITY',\n 'TEXTSIZE',\n 'TRANSACTION ISOLATION LEVEL',\n 'TRIGGER',\n 'TRUNCATE TABLE',\n 'TYPE',\n 'UPDATE',\n 'UPDATE STATISTICS',\n 'USER',\n 'VIEW',\n 'WORKLOAD GROUP',\n 'XACT_ABORT',\n 'XML INDEX',\n 'XML SCHEMA COLLECTION',\n // other\n 'ALTER COLUMN',\n 'ALTER TABLE',\n 'CREATE TABLE',\n 'FROM',\n 'GROUP BY',\n 'HAVING',\n 'INSERT INTO', // verify\n 'DROP TABLE', // verify\n 'SET SCHEMA', // verify\n 'LIMIT',\n 'OFFSET',\n 'ORDER BY',\n 'SELECT',\n 'VALUES',\n 'WHERE',\n 'WITH',\n];\n\n/**\n * Priority 2\n * commands that operate on two tables or subqueries\n * two main categories: joins and boolean set operators\n */\nconst reservedBinaryCommands = [\n // set booleans\n 'INTERSECT',\n 'INTERSECT ALL',\n 'INTERSECT DISTINCT',\n 'UNION',\n 'UNION ALL',\n 'UNION DISTINCT',\n 'EXCEPT',\n 'EXCEPT ALL',\n 'EXCEPT DISTINCT',\n 'MINUS',\n 'MINUS ALL',\n 'MINUS DISTINCT',\n // joins\n 'JOIN',\n 'INNER JOIN',\n 'LEFT JOIN',\n 'LEFT OUTER JOIN',\n 'RIGHT JOIN',\n 'RIGHT OUTER JOIN',\n 'FULL JOIN',\n 'FULL OUTER JOIN',\n 'CROSS JOIN',\n];\n\n/**\n * Priority 3\n * keywords that follow a previous Statement, must be attached to subsequent data\n * can be fully inline or on newline with optional indent\n */\nconst reservedDependentClauses = ['WHEN', 'ELSE'];\n\n// https://docs.microsoft.com/en-us/sql/t-sql/language-reference?view=sql-server-ver15\nexport default class TSqlFormatter extends Formatter {\n static reservedCommands = reservedCommands;\n static reservedBinaryCommands = reservedBinaryCommands;\n static reservedDependentClauses = reservedDependentClauses;\n static reservedJoinConditions = ['ON', 'USING'];\n static reservedLogicalOperators = ['AND', 'OR'];\n static reservedKeywords = dedupe([\n ...Object.values(reservedFunctions).reduce((acc, arr) => [...acc, ...arr], []),\n ...Object.values(reservedKeywords).reduce((acc, arr) => [...acc, ...arr], []),\n ]);\n static stringTypes: StringPatternType[] = [`\"\"`, \"N''\", \"''\", '[]', '``'];\n static blockStart = ['(', 'CASE'];\n static blockEnd = [')', 'END'];\n static indexedPlaceholderTypes = [];\n static namedPlaceholderTypes = ['@'];\n static lineCommentTypes = ['--'];\n static specialWordChars = { any: '#@' };\n static operators = ['!<', '!>', '+=', '-=', '*=', '/=', '%=', '|=', '&=', '^=', '::'];\n\n tokenizer() {\n return new Tokenizer({\n reservedCommands: TSqlFormatter.reservedCommands,\n reservedBinaryCommands: TSqlFormatter.reservedBinaryCommands,\n reservedDependentClauses: TSqlFormatter.reservedDependentClauses,\n reservedJoinConditions: TSqlFormatter.reservedJoinConditions,\n reservedLogicalOperators: TSqlFormatter.reservedLogicalOperators,\n reservedKeywords: TSqlFormatter.reservedKeywords,\n stringTypes: TSqlFormatter.stringTypes,\n blockStart: TSqlFormatter.blockStart,\n blockEnd: TSqlFormatter.blockEnd,\n indexedPlaceholderTypes: TSqlFormatter.indexedPlaceholderTypes,\n namedPlaceholderTypes: TSqlFormatter.namedPlaceholderTypes,\n lineCommentTypes: TSqlFormatter.lineCommentTypes,\n specialWordChars: TSqlFormatter.specialWordChars,\n operators: TSqlFormatter.operators,\n // TODO: Support for money constants\n });\n }\n}\n","import BigQueryFormatter from './languages/bigquery.formatter';\nimport Db2Formatter from './languages/db2.formatter';\nimport HiveFormatter from './languages/hive.formatter';\nimport MariaDbFormatter from './languages/mariadb.formatter';\nimport MySqlFormatter from './languages/mysql.formatter';\nimport N1qlFormatter from './languages/n1ql.formatter';\nimport PlSqlFormatter from './languages/plsql.formatter';\nimport PostgreSqlFormatter from './languages/postgresql.formatter';\nimport RedshiftFormatter from './languages/redshift.formatter';\nimport SparkSqlFormatter from './languages/sparksql.formatter';\nimport StandardSqlFormatter from './languages/standardsql.formatter';\nimport TSqlFormatter from './languages/tsql.formatter';\n\nimport { FormatOptions } from './types';\nimport { isNumber } from './utils';\n\nexport const formatters = {\n bigquery: BigQueryFormatter,\n db2: Db2Formatter,\n hive: HiveFormatter,\n mariadb: MariaDbFormatter,\n mysql: MySqlFormatter,\n n1ql: N1qlFormatter,\n plsql: PlSqlFormatter,\n postgresql: PostgreSqlFormatter,\n redshift: RedshiftFormatter,\n spark: SparkSqlFormatter,\n sql: StandardSqlFormatter,\n tsql: TSqlFormatter,\n};\nexport type SqlLanguage = keyof typeof formatters;\nexport const supportedDialects = Object.keys(formatters);\n\nexport type FormatFnOptions = FormatOptions & { language: SqlLanguage };\n\nconst defaultOptions: FormatFnOptions = {\n language: 'sql',\n tabWidth: 2,\n useTabs: false,\n keywordCase: 'preserve',\n indentStyle: 'standard',\n multilineLists: 'always',\n logicalOperatorNewline: 'before',\n aliasAs: 'preserve',\n tabulateAlias: false,\n commaPosition: 'after',\n newlineBeforeOpenParen: true,\n newlineBeforeCloseParen: true,\n expressionWidth: 50,\n linesBetweenQueries: 1,\n denseOperators: false,\n newlineBeforeSemicolon: false,\n};\n\n/**\n * Format whitespace in a query to make it easier to read.\n *\n * @param {string} query - input SQL query string\n * @param {FormatOptions} cfg Configuration options (see docs in README)\n * @return {string} formatted query\n */\nexport const format = (query: string, cfg: Partial<FormatFnOptions> = {}): string => {\n if (typeof query !== 'string') {\n throw new Error('Invalid query argument. Expected string, instead got ' + typeof query);\n }\n\n const options = validateConfig({\n ...defaultOptions,\n ...cfg,\n });\n\n const Formatter = formatters[options.language];\n return new Formatter(options).format(query);\n};\n\nexport class ConfigError extends Error {}\n\nfunction validateConfig(cfg: FormatFnOptions): FormatFnOptions {\n if (!supportedDialects.includes(cfg.language)) {\n throw new ConfigError(`Unsupported SQL dialect: ${cfg.language}`);\n }\n\n if (isNumber(cfg.multilineLists) && cfg.multilineLists <= 0) {\n throw new ConfigError('multilineLists config must be a positive number.');\n }\n\n if (cfg.expressionWidth <= 0) {\n throw new ConfigError(\n `expressionWidth config must be positive number. Received ${cfg.expressionWidth} instead.`\n );\n }\n\n if (cfg.commaPosition === 'before' && cfg.useTabs) {\n throw new ConfigError(\n 'commaPosition: before does not work when tabs are used for indentation.'\n );\n }\n\n return cfg;\n}\n\nexport type FormatFn = typeof format;\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","dedupe","arr","Set","trimSpacesEnd","str","replace","escapeRegExp","string","sortByLengthDesc","strings","sort","a","b","length","localeCompare","maxLength","reduce","max","cur","Math","TokenType","INDENT_TYPE_TOP_LEVEL","Indentation","indent","indentTypes","this","repeat","push","pop","EOF_TOKEN","type","EOF","spaces","testToken","compareToken","token","RegExp","test","isToken","AS","RESERVED_KEYWORD","AND","RESERVED_LOGICAL_OPERATOR","BETWEEN","CASE","BLOCK_START","CAST","BY","END","BLOCK_END","FROM","RESERVED_COMMAND","LIMIT","SELECT","SET","TABLE","WINDOW","WITH","isCommand","RESERVED_BINARY_COMMAND","isReserved","RESERVED_DEPENDENT_CLAUSE","RESERVED_JOIN_CONDITION","InlineBlock","expressionWidth","level","tokens","index","isInlineBlock","i","isForbiddenToken","BLOCK_COMMENT","Params","params","createReservedWordRegex","reservedKeywords","specialWordChars","reservedKeywordsPattern","join","patterns","createStringPattern","stringTypes","map","t","escapeParen","paren","createParenRegex","parens","createPlaceholderRegex","types","pattern","Array","isArray","typesRegex","WHITESPACE_REGEX","NULL_REGEX","Tokenizer","cfg","matchToken","tokenType","input","getTokenOnFirstMatch","regex","REGEX_MAP","lineCommentTypes","polyadOperators","specialWordCharsAll","values","_a","WORD","specialChars","prefixLookBehind","prefix","suffixLookAhead","suffix","_b","unicodeWordChar","any","_c","arrayAccessor","mapAccessor","regexFactory","STRING","reservedDependentClauses","reservedLogicalOperators","reservedCommands","reservedBinaryCommands","reservedJoinConditions","OPERATOR","operators","split","blockStart","blockEnd","LINE_COMMENT","c","NUMBER","PLACEHOLDER","INDEXED_PLACEHOLDER_REGEX","indexedPlaceholderTypes","_d","IDENT_NAMED_PLACEHOLDER_REGEX","namedPlaceholderTypes","STRING_NAMED_PLACEHOLDER_REGEX","whitespaceBefore","getWhitespace","substring","getNextToken","matches","match","previousToken","getPlaceholderToken","getReservedWordToken","parseKey","v","slice","getEscapedPlaceholderKey","quoteChar","acc","undefined","matchedToken","formatCommaPositions","query","commaPosition","lines","groups","group","groupCommaDelimitedLines","flatMap","commaLines","maxLineLength","trimTrailingCommas","line","formatTabular","whitespace","removeLastIndent","trimStart","formatBefore","Error","toTabularToken","indentStyle","bufferItem","tail","includes","padEnd","padStart","AliasAs","aliasAs","formatter","isMissingTableAlias","isMissingSelectColumnAlias","lookBehind","prevToken","nextToken","lookAhead","isWithinSelect","isEdgeCaseCTE","isEdgeCaseCreateTable","isMissingTypeCastAs","getPreviousReservedToken","endsWith","isRemovableNonSelectAs","n","tokenLookBehind","tokenLookAhead","AsTokenFactory","keywordCase","detectedCase","autoDetectCase","asTokens","filter","asTokenValue","Formatter","currentNewline","previousReservedToken","previousCommandToken","indentation","indentString","inlineBlock","asTokenFactory","isTabularStyle","useTabs","tabWidth","tokenizer","tokenize","formattedQuery","getFormattedQueryFromTokens","postFormat","trimEnd","tabulateAlias","newQuery","aliasLines","splitLines","precedingText","as","alias","aliasMaxLength","formatAliasPositions","tokenOverride","formatLineComment","formatBlockComment","checkNewline","formatCommand","formatBinaryCommand","formatDependentClause","formatJoinCondition","formatLogicalOperator","formatKeyword","formatBlockStart","formatBlockEnd","formatPlaceholder","formatOperator","formatWord","finalQuery","shouldAddBefore","formatWithSpaces","shouldAddAfter","nextTokens","tokensUntilNextCommandOrQueryEnd","some","multilineLists","inlineWidth","countClauses","tokensString","count","openBlocks","findIndex","addNewline","show","indentComment","comment","getIndent","decreaseTopLevel","increaseTopLevel","equalizeWhitespace","isJoin","shouldRemove","formatComma","formatQuerySeparator","denseOperators","formatWithoutSpaces","logicalOperatorNewline","preserveWhitespaceFor","newlineBeforeOpenParen","beginIfPossible","isActive","increaseBlockLevel","end","decreaseBlockLevel","getSingleIndent","newlineBeforeCloseParen","addSpace","before","after","resetIndentation","newlineBeforeSemicolon","linesBetweenQueries","toUpperCase","toLowerCase","BigQueryFormatter","fullReservedWords","finalToken","splice","aead","aggregateAnalytic","aggregate","approximateAggregate","array","bitwise","conversion","date","datetime","debugging","federatedQuery","geography","hash","hll","interval","json","math","navigation","net","numbering","security","statisticalAggregate","time","timestamp","uuid","conditional","legacyAggregate","legacyBitwise","legacyCasting","legacyComparison","legacyDatetime","legacyIp","legacyJson","legacyMath","legacyRegex","legacyString","legacyTableWildcard","legacyUrl","legacyWindow","legacyMisc","other","keywords","datatypes","stringFormat","misc","Db2Formatter","scalar","table","row","olap","standard","onlineUtilies","commands","HiveFormatter","masking","nonReserved","reserved","fileTypes","MariaDbFormatter","MySqlFormatter","N1qlFormatter","PlSqlFormatter","startsWith","PostgreSqlFormatter","binary","bitstring","datatype","enum","geometry","network","textsearch","xml","sequence","range","window","set","sysInfo","sysAdmin","trigger","eventTrigger","stats","RedshiftFormatter","dateTime","spatial","hyperLogLog","machineLearning","superType","dataType","dataConversionParams","dataLoadParams","dataFormatParams","copyAuthParams","copyCompressionParams","copyMiscParams","compressionEncodings","dataTypes","SparkSqlFormatter","StandardSqlFormatter","TSqlFormatter","analytic","configuration","cryptographic","cursor","mathematical","metadata","ranking","system","statistical","odbc","future","formatters","bigquery","db2","hive","mariadb","mysql","n1ql","plsql","postgresql","redshift","spark","sql","tsql","supportedDialects","keys","defaultOptions","language","format","options","validateConfig","ConfigError"],"sourceRoot":""} |